|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--jumbo.euclid.Status
|
+--jumbo.euclid.IntRange
IntRange - maximum and minimum values
Contains two ints representing the minimum and maximum of an allowed or observed range.
Default is range with low > high; this can be regarded as the uninitialised state. If points are added to a default IntRange it becomes initialised.
| Field Summary | |
protected int |
maxval
maximum of range |
protected int |
minval
minimum of range |
| Constructor Summary | |
IntRange()
creates invalid range from MAX_VALUE to MIN_VALUE |
|
IntRange(int minv,
int maxv)
initialise with min and max values; if minv > maxv create inValid IntRange |
|
IntRange(IntRange r)
copy constructor |
|
| Method Summary | |
void |
add(int x)
add a value to a range |
boolean |
contains(int f)
synonym for includes() |
boolean |
equals(IntRange r)
invalid ranges return false |
int |
getMax()
get maximum value (MIN_VALUE if inValid) |
int |
getMin()
get minimum value (MAX_VALUE if inValid) |
int |
getRange()
get range (MIN_VALUE if invalid) |
boolean |
includes(int f)
is a int within a IntRange? If inValid, return false |
boolean |
includes(IntRange r2)
does one range include another? |
IntRange |
intersectionWith(IntRange r2)
intersect two ranges and take the range common to both; return invalid range if no overlap |
boolean |
isValid()
a Range is only valid if its maxval is not less than its minval; this tests for uninitialised ranges |
static void |
main(java.lang.String[] args)
tests IntRange routines |
IntRange |
plus(IntRange r2)
combine two ranges if both valid; takes greatest limits of both, else returns InValid |
java.lang.String |
toString()
output |
| Methods inherited from class jumbo.euclid.Status |
NYI |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected int maxval
protected int minval
| Constructor Detail |
public IntRange()
public IntRange(int minv,
int maxv)
public IntRange(IntRange r)
| Method Detail |
public boolean isValid()
public boolean equals(IntRange r)
public IntRange plus(IntRange r2)
public IntRange intersectionWith(IntRange r2)
public int getMin()
public int getMax()
public int getRange()
public boolean includes(IntRange r2)
public boolean includes(int f)
public boolean contains(int f)
public void add(int x)
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||