edu.ucsb.ccs.jaqual
Class Exists

java.lang.Object
  |
  +--edu.ucsb.ccs.jaqual.Exists

public class Exists
extends java.lang.Object

Exists quantifier. Evaluates true if a test succeeds for at least one element in a collection.

Example:

   Exists.in(myCollection).suchThat(new Equal(0));
 

Version:
$Id: Exists.java,v 1.4 2002/07/13 08:42:19 parkera Exp $
Author:
Parker Abercrombie

Constructor Summary
Exists(java.util.Collection c)
          Create a new Exists quantifier.
Exists(java.lang.Object[] array)
          Create a new Exists quantifier for an array.
 
Method Summary
static Exists in(java.util.Collection c)
          Create a new Exists quantifier.
 boolean suchThat(Assertion a)
          Evaluate the quantifier on all objects in the collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exists

public Exists(java.util.Collection c)
Create a new Exists quantifier.

Parameters:
c - the collection of object to which quantifier applies.

Exists

public Exists(java.lang.Object[] array)
Create a new Exists quantifier for an array.

Parameters:
array - the array of objects to which quantifier applies.
Method Detail

in

public static Exists in(java.util.Collection c)
Create a new Exists quantifier.

Parameters:
c - the collection of object to which quantifier applies.

suchThat

public boolean suchThat(Assertion a)
Evaluate the quantifier on all objects in the collection. Return true if the specified test evaluates true on at least one object.

Parameters:
a - a test to evaluate on each object.
Returns:
true if `a' evaluates true on at least one object in the collection.