edu.ucsb.ccs.jaqual
Class ForAll

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

public class ForAll
extends java.lang.Object

A forall quantifier. Evaluates true if a test succeeds on all objects in a collection.

Example:

   ForAll.in(myCollection).ensure(new Equal(0));
 

ForAll can also be used to apply an Operator to all objects in a collection.

Version:
$Id: ForAll.java,v 1.5 2002/07/13 08:44:38 parkera Exp $
Author:
Parker Abercrombie
See Also:
Operator

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

Constructor Detail

ForAll

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

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

ForAll

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

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

in

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

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

ensure

public boolean ensure(Assertion a)
Evaluate the quantifier on all objects in the collection. Return true if the specified assertion evaluates true on each object.

Parameters:
a - an assertion to evaluate on each object.
Returns:
true if `a' evaluates true on each object in the collection.

execute

public void execute(Operator o)
Execute an operator on all objects in the collection.

Parameters:
o - an Operator to be applied to each object.