org.jutil.predicate
Class PrimitiveTotalPredicate
java.lang.Object
|
+--org.jutil.predicate.AbstractPredicate
|
+--org.jutil.predicate.TotalPredicate
|
+--org.jutil.predicate.PrimitiveTotalPredicate
- All Implemented Interfaces:
- CollectionOperator, Predicate
- Direct Known Subclasses:
- Equal, False, Identical, NotNull, True, TypePredicate
- public abstract class PrimitiveTotalPredicate
- extends TotalPredicate
A class of total predicates that have no subpredicates.
This class implements the
nbSubPredicates()
and getSubPredicates()
methods for predicates that don't contain any sub predicates.
Typically, this class will be used as an anonymous inner class as follows:
TotalPredicate myPredicate = new PrimitiveTotalPredicate() {
public boolean eval(Object o) {
//calculate boolean value
//using the given object
}
};
| 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
PrimitiveTotalPredicate
public PrimitiveTotalPredicate()
getSubPredicates
public java.util.List getSubPredicates()
- Description copied from interface:
Predicate
- Return the subpredicates of this Predicate.
- Specifications:
- also
-
public behavior
ensures \result .size() == 0;
- 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 inherited from overridden method in class AbstractPredicate:
--- None ---
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures \result == getSubPredicates().size();