org.imemex.predicates
Class And

java.lang.Object
  extended by org.imemex.predicates.BinaryPredicate
      extended by org.imemex.predicates.And
All Implemented Interfaces:
Predicate

public class And
extends BinaryPredicate


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.imemex.predicates.Predicate
Predicate.PredType
 
Constructor Summary
And(Predicate predicate1, Predicate predicate2)
           
 
Method Summary
 Predicate copy()
          makes an exact copy of this predicate
 boolean equals(Predicate p, boolean deep)
          Compares this predicate to the given predicate p.
<T> boolean
eval(java.util.Map<java.lang.String,T> variableBindings)
          Evaluates the predicate with the given map of pairs.
 
Methods inherited from class org.imemex.predicates.BinaryPredicate
getFirstPredicate, getSecondPredicate, getType, getVariables, renameVariable, toString, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

And

public And(Predicate predicate1,
           Predicate predicate2)
Method Detail

eval

public <T> boolean eval(java.util.Map<java.lang.String,T> variableBindings)
             throws UnboundVariableException
Description copied from interface: Predicate
Evaluates the predicate with the given map of pairs.

Parameters:
variableBindings - - a map that specifies the bindings for the predicate variables.
Returns:
true, if the predicate is true; false, otherwise.
Throws:
UnboundVariableException - - if some variable necessary to evaluate the predicate was not bound.

equals

public boolean equals(Predicate p,
                      boolean deep)
Description copied from interface: Predicate
Compares this predicate to the given predicate p.

deep - true if type, variable names, and values have to match,
false if only type has to match.
Returns:

copy

public Predicate copy()
Description copied from interface: Predicate
makes an exact copy of this predicate

Returns: