org.jutil.predicate
Class Implication

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

public class Implication
extends BinaryPredicate

A class of predicates that evaluates to the implication of two other predicates. This is the logical ==> operator.


Field Summary
static java.lang.String CVS_REVISION
           
 
Constructor Summary
Implication(Predicate first, Predicate second)
          Initialize a new Implication 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

Implication

public Implication(Predicate first,
                   Predicate second)
Initialize a new Implication 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);