SSF.OS.BGP4.Policy
Class Predicate

java.lang.Object
  |
  +--SSF.OS.BGP4.Policy.Predicate

public class Predicate
extends java.lang.Object

Each instance of this class represents a predicate on a route. Such predicates can be mapped to certain types of actions to compose a clause in a BGP policy rule. A full predicate is a conjunction of smaller parts or atomic predicates. The full predicate is satisfied if each atomic predicate evaluates to 'true'. If the full predicate is composed of zero atomic predicates, then it evaluates to 'true' by default.

See Also:
Rule, Clause, Action, AtomicPredicate

Constructor Summary
Predicate()
          Builds a predicate with no atoms.
Predicate(java.util.ArrayList atomlist)
          Builds a predicate with the given atoms.
 
Method Summary
 void add_atom(AtomicPredicate newatom)
          Adds the given atom to the predicate.
 boolean apply_to(Route r)
          Applies this predicate to the given route and returns true only if it matches.
 java.lang.String toString()
          Puts the predicate into string form suitable for output.
 java.lang.String toString(java.lang.String ind)
          Puts the predicate into string form suitable for output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Predicate

public Predicate()
Builds a predicate with no atoms.


Predicate

public Predicate(java.util.ArrayList atomlist)
Builds a predicate with the given atoms.

Method Detail

add_atom

public void add_atom(AtomicPredicate newatom)
Adds the given atom to the predicate.


apply_to

public boolean apply_to(Route r)
Applies this predicate to the given route and returns true only if it matches.

Returns:
whether or not the predicate matches the route

toString

public java.lang.String toString()
Puts the predicate into string form suitable for output.

Overrides:
toString in class java.lang.Object
Returns:
the predicate in string form

toString

public java.lang.String toString(java.lang.String ind)
Puts the predicate into string form suitable for output.

Parameters:
ind - A string to use as a prefix for each line in the string.
Returns:
the predicate in string form