org.jutil.predicate
Class Not
java.lang.Object
|
+--org.jutil.predicate.AbstractPredicate
|
+--org.jutil.predicate.Not
- All Implemented Interfaces:
- CollectionOperator, Predicate
- public class Not
- extends AbstractPredicate
A class of predicates that negate another predicate.
|
Constructor Summary |
Not(Predicate predicate)
Initialize a new Not with the given predicate. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CVS_REVISION
public static final java.lang.String CVS_REVISION
Not
public Not(Predicate predicate)
- Initialize a new Not with the given predicate.
- Parameters:
predicate - The predicate to be negated.
- Specifications:
-
public behavior
requires predicate != null;
ensures getPredicate() == predicate;
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 == !getPredicate().eval(object);
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures \result == true|\result == false;
signals (Exception) !isValidElement(object);
getPredicate
public Predicate getPredicate()
- Return the negated predicate.
- Specifications:
-
public behavior
ensures \result == getSubPredicates().get(1);
getSubPredicates
public java.util.List getSubPredicates()
- See superclass
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures \result != null;
ensures !\result .contains(null);
ensures !\result .contains(this);
nbSubPredicates
public int nbSubPredicates()
- See superclass
- Specifications:
- also
-
public behavior
ensures \result == 1;
- Specifications inherited from overridden method in class AbstractPredicate:
--- None ---
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures \result == getSubPredicates().size();