|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.ucsb.ccs.jaqual.standard.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));
| Field Summary | |
static int |
CONTENT
Constant for comparison by value. |
static int |
REFERENCE
Constant for comparison by reference. |
| Constructor Summary | |
Equal(byte value)
Create an assertion to compare bytes. |
|
Equal(char value)
Create an assertion to compare characters. |
|
Equal(double value)
Create an assertion to compare double precision numbers, using Double.MIN_VALUE as the tolerance. |
|
Equal(double value,
double tolerance)
Create an assertion to compare double precision numbers. |
|
Equal(float value)
Create an assertion to compare floating point numbers, using Float.MIN_VALUE as the tolerance. |
|
Equal(float value,
double tolerance)
Create an assertion to compare floating point numbers. |
|
Equal(int value)
Create an assertion to compare integers. |
|
Equal(long value)
Create an assertion to compare longs. |
|
Equal(java.lang.Object value)
Create an assertion to compare Objects by content. |
|
Equal(java.lang.Object value,
int mode)
Create an assertion to compare Objects. |
|
Equal(short value)
Create an assertion to compare shorts. |
|
| Method Summary | |
boolean |
eval(java.lang.Object o)
Test an object to see if it is equal to the target value. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int CONTENT
public static final int REFERENCE
| Constructor Detail |
public Equal(java.lang.Object value)
public Equal(java.lang.Object value,
int mode)
value - the value to compare things with.mode - the comparison mode, either CONTENT or REFERENCE.public Equal(int value)
public Equal(long value)
public Equal(short value)
public Equal(byte value)
public Equal(char value)
public Equal(float value)
public Equal(float value,
double tolerance)
value - the value to compare things with.tolerance - the tolerance to use in the floating point
comparison.public Equal(double value)
public Equal(double value,
double tolerance)
value - the value to compare things with.tolerance - the tolerance to use in the comparison.| Method Detail |
public boolean eval(java.lang.Object o)
eval in interface Assertiono - the object to test. If `o' is of type Float or Double,
the comparison will be performed by value, and using a
tolerance.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||