org.jutil.predicate
Class AbstractPredicate
java.lang.Object
|
+--org.jutil.predicate.AbstractPredicate
- All Implemented Interfaces:
- CollectionOperator, Predicate
- Direct Known Subclasses:
- BinaryPredicate, CompositePredicate, FilePredicate, Not, PrimitivePredicate, TotalPredicate
- public abstract class AbstractPredicate
- extends java.lang.Object
- implements Predicate
|
Method Summary |
int |
count(java.util.Collection collection)
See superclass |
boolean |
equals(java.lang.Object other)
See superclass |
boolean |
exists(java.util.Collection collection)
See superclass |
void |
filter(java.util.Collection collection)
See superclass |
boolean |
forall(java.util.Collection collection)
See superclass |
int |
nbSubPredicates()
See superclass |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractPredicate
public AbstractPredicate()
exists
public boolean exists(java.util.Collection collection)
throws java.util.ConcurrentModificationException,
java.lang.Exception
- See superclass
- Specifications: pure
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures collection != null ==> \result == ( \exists Object o; Collections.containsExplicitly(collection,o); eval(o) == true);
ensures collection == null ==> \result == false;
signals (ConcurrentModificationException) (* The collection was modified while accumulating *);
signals (Exception) (collection != null)&&( \exists Object o; (collection != null)&&Collections.containsExplicitly(collection,o); !isValidElement(o));
forall
public boolean forall(java.util.Collection collection)
throws java.util.ConcurrentModificationException,
java.lang.Exception
- See superclass
- Specifications: pure
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures collection != null ==> \result == ( \forall Object o; Collections.containsExplicitly(collection,o); eval(o) == true);
ensures collection == null ==> \result == true;
signals (ConcurrentModificationException) (* The collection was modified while accumulating *);
signals (Exception) (collection != null)&&( \exists Object o; (collection != null)&&Collections.containsExplicitly(collection,o); !isValidElement(o));
count
public int count(java.util.Collection collection)
throws java.util.ConcurrentModificationException,
java.lang.Exception
- See superclass
- Specifications: pure
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures collection != null ==> \result == ( \num_of Object o; Collections.containsExplicitly(collection,o); eval(o) == true);
ensures collection == null ==> \result == 0;
signals (ConcurrentModificationException) (* The collection was modified while accumulating *);
signals (Exception) (collection != null)&&( \exists Object o; (collection != null)&&Collections.containsExplicitly(collection,o); !isValidElement(o));
filter
public void filter(java.util.Collection collection)
throws java.util.ConcurrentModificationException,
java.lang.Exception
- See superclass
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures collection != null ==> ( \forall Object o; Collections.containsExplicitly(collection,o); eval(o) == true);
ensures collection != null ==> ( \forall Object o; \old(Collections.containsExplicitly(collection,o)); (eval(o) == true) ==> (Collections.nbExplicitOccurrences(o,collection) == \old(Collections.nbExplicitOccurrences(o,collection))));
signals (ConcurrentModificationException) (* The collection was modified while accumulating *);
signals (Exception) (collection != null)&&( \exists Object o; (collection != null)&&Collections.containsExplicitly(collection,o); !isValidElement(o));
equals
public final boolean equals(java.lang.Object other)
- See superclass
- Specifications inherited from overridden method in interface Predicate:
- also
-
public behavior
ensures \result == (other instanceof Predicate)&&( \forall Object o; ; ((Predicate)other).isValidElement(o) == isValidElement(o)&&((Predicate)other).isValidElement(o) ==> ((Predicate)other).eval(o) == eval(o));
nbSubPredicates
public int nbSubPredicates()
- See superclass
- Specifications inherited from overridden method in interface Predicate:
-
public behavior
ensures \result == getSubPredicates().size();