| Home >> All >> edu >> ucsb >> ccs >> [ jaqual Javadoc ] |
| | edu.ucsb.ccs.jaqual.standard.* (4) | | edu.ucsb.ccs.jaqual.test.* (8) |
edu.ucsb.ccs.jaqual: Javadoc index of package edu.ucsb.ccs.jaqual.
Package Samples:
edu.ucsb.ccs.jaqual.standard: This is the main package of the JaQuaL library.
edu.ucsb.ccs.jaqual.test
Classes:
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); } });
Operator: Interface for an object that transforms other objects. Using the ForAll quantifier, Operators allow you to easily apply some function to all the elements in a Collection. Operators are similar to Assertions, but an Assertion simply evaluates to a boolean leaving it's argument unchanged. An Operator performs some operation on the argument.
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));
ForAll: 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.
InRange: An assertion to determine if a number falls in a given range. The assertion supports both integer and floating point comparison. You can specify whether or not the bounding values are included or excluded from the range.
Equal: An assertion to test for equality. Supports comparison by reference and value, and comparison of floating point numbers. Example use: Exists.in(elements).suchThat(new Equal(5));
Exists: Exists quantifier. Evaluates true if a test succeeds for at least one element in a collection. Example: Exists.in(myCollection).suchThat(new Equal(0));
InstanceOf: Assertion to check if an object is an instance of a certain class type. Example use: ForAll.in(elements).ensure(new InstanceOf(Integer.class));
Not: Assertion that negates another assertion. Example use: ForAll.in(elements).ensure(new Not(new Equal(0)));
Logical: This class defines some useful logic operators.
TestInstanceOf: Unit test for the InstanceOf assertion.
TestElements: Unit test for the Elements quantifier.
TestOperator: Unit test for the Operator interface.
TestInRange: Unit test for the InRange assertion.
TestExists: Unit test for the Exists quantifier.
TestForAll: Unit test for the ForAll quantifier.
TestEqual: Unit test for the Equal assertion.
TestNot: Unit test for the Not assertion.
| Home | Contact Us | Privacy Policy | Terms of Service |