org.jutil.predicate
Class Xor

java.lang.Object
  |
  +--org.jutil.predicate.AbstractPredicate
        |
        +--org.jutil.predicate.BinaryPredicate
              |
              +--org.jutil.predicate.Xor
All Implemented Interfaces:
CollectionOperator, Predicate

public class Xor
extends BinaryPredicate

A class of predicates that evaluates to the xor of two other predicates.


Field Summary
static java.lang.String CVS_REVISION
           
 
Constructor Summary
Xor(Predicate first, Predicate second)
          Initialize a new Xor with the given predicates.
 
Method Summary
 boolean eval(java.lang.Object object)
          Evaluate this Predicate for the given object.
 
Methods inherited from class org.jutil.predicate.BinaryPredicate
getFirst, getSecond, getSubPredicates, nbSubPredicates, setFirst, setSecond
 
Methods inherited from class org.jutil.predicate.AbstractPredicate
count, equals, exists, filter, forall
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jutil.java.collections.CollectionOperator
isValidElement
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Constructor Detail

Xor

public Xor(Predicate first,
           Predicate second)
Initialize a new Xor with the given predicates.

Parameters:
first - The first predicate.
second - The second predicate.

Specifications:
public behavior
requires first != null;
requires second != null;
ensures getFirst() == first;
ensures getSecond() == second;
Method Detail

eval

public boolean eval(java.lang.Object object)
             throws java.lang.Exception
Description copied from interface: Predicate
Evaluate this Predicate for the given object.

Specifications:
     also
public behavior
ensures \result == getFirst().eval(object)^getSecond().eval(object);

Specifications inherited from overridden method in interface Predicate:
public behavior
ensures \result == true|\result == false;
signals (Exception) !isValidElement(object);