|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.ucsb.ccs.jaqual.standard.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.
| Field Summary | |
static int |
EXCLUSIVE
Constant to indicate the bound is exclusive. |
static int |
INCLUSIVE
Constant to indicate the bound is inclusive. |
| Constructor Summary | |
InRange(double minVal,
double maxVal,
double tolerance)
Create an assertion to test that a value falls in the interval [minVal, maxVal]. |
|
InRange(double minVal,
double maxVal,
double tolerance,
int mode)
Create an assertion to test that a value falls in the interval [minVal, maxVal]. |
|
InRange(double minVal,
double maxVal,
double tolerance,
int lowerMode,
int upperMode)
Create an assertion to test that a value falls in the interval [minVal, maxVal]. |
|
InRange(long minVal,
long maxVal)
Create an assertion to test that a value falls in the interval [minVal, maxVal]. |
|
InRange(long minVal,
long maxVal,
int mode)
Create an assertion to test that a value falls between `minVal' and `maxVal'. |
|
InRange(long minVal,
long maxVal,
int lowerMode,
int upperMode)
Create an assertion to test that a value falls between `minVal' and `maxVal'. |
|
| Method Summary | |
boolean |
eval(java.lang.Object o)
Determine if a value is in the allowed range. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int INCLUSIVE
public static final int EXCLUSIVE
| Constructor Detail |
public InRange(long minVal,
long maxVal)
minVal - the lower bound.maxVal - the upper bound.
public InRange(long minVal,
long maxVal,
int mode)
minVal - the lower bound.maxVal - the upper bound.mode - the comparison mode to use for both bounds, either
INCLUSIVE or EXCLUSIVE.
public InRange(long minVal,
long maxVal,
int lowerMode,
int upperMode)
minVal - the lower bound.maxVal - the upper bound.lowerMode - the comparison mode to use for the lower bound, either
INCLUSIVE or EXCLUSIVE.upperMode - the comparison mode to use for the upper bound, either
INCLUSIVE or EXCLUSIVE.
public InRange(double minVal,
double maxVal,
double tolerance)
minVal - the lower bound.maxVal - the upper bound.tolerance - the tolerance to use in the floating point
comparison.
public InRange(double minVal,
double maxVal,
double tolerance,
int mode)
minVal - the lower bound.maxVal - the upper bound.tolerance - the tolerance to use in the floating point
comparison.mode - the comparison mode to use for both bounds, either
INCLUSIVE or EXCLUSIVE.
public InRange(double minVal,
double maxVal,
double tolerance,
int lowerMode,
int upperMode)
minVal - the lower bound.maxVal - the upper bound.tolerance - the tolerance to use in the floating point
comparison.lowerMode - the comparison mode to use for the lower bound, either
INCLUSIVE or EXCLUSIVE.upperMode - the comparison mode to use for the upper bound, either
INCLUSIVE or EXCLUSIVE.| Method Detail |
public boolean eval(java.lang.Object o)
throws java.lang.IllegalArgumentException
eval in interface Assertiono - the value to examine. This must be an instance of
java.lang.Number.
java.lang.IllegalArgumentException - if `o' is not an instance of
java.lang.Number.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||