|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.ucsb.ccs.jaqual.Elements
Quantifier to find a subset of a collection that matches certain criteria. For example, in the collection {1, 2, 3, 4, 5}, one might wish to extract the integers that are greater than zero. We can code this as:
Example:
Vector positiveEls = Elements.in(myCollection).suchThat(new InRange(0, Integer.MAX_VALUE));
| Constructor Summary | |
Elements(java.util.Collection c)
Create a new elements quantifier. |
|
Elements(java.lang.Object[] array)
Create a new Elements quantifier for an array. |
|
| Method Summary | |
static Elements |
in(java.util.Collection c)
Create a new elements quantifier. |
java.util.Vector |
suchThat(Assertion a)
Find the subset of the collection that meets a given assertion. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Elements(java.util.Collection c)
c - the collection of object to which quantifier applies.public Elements(java.lang.Object[] array)
array - the array of objects to which quantifier applies.| Method Detail |
public static Elements in(java.util.Collection c)
c - the collection of object to which quantifier applies.public java.util.Vector suchThat(Assertion a)
a - the test to apply to objects in the collection.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||