edu.ucsb.ccs.jaqual
Interface Assertion

All Known Implementing Classes:
Equal, InRange, InstanceOf, Not

public interface Assertion

Abstract description of an assertion that can be evaluated on an element of a collection.

Assertions can be (fairly) easily defined inline using anonymous classes:

    // Make sure that Vector `v' contains only Integers.
    ForAll.in(collection).ensure(new Assertion() {
      public boolean eval(Object o) {
        return (o instanceof Integer);
      }
     });
 

Version:
$Id: Assertion.java,v 1.1 2002/05/02 06:27:15 parkera Exp $
Author:
Parker Abercrombie

Method Summary
 boolean eval(java.lang.Object o)
          Evaluate the assertion on an object.
 

Method Detail

eval

public boolean eval(java.lang.Object o)
Evaluate the assertion on an object.

Parameters:
o - the object to test.
Returns:
true if the assertion evaluates true.