|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Stores an ordered pair of comparable objects that together describe a half-open interval.
| Method Summary | |
Interval |
change(java.lang.Comparable start,
java.lang.Comparable stop)
Since an Interval is designed to be immutable, you need this thing to change the interval. |
boolean |
contains(java.lang.Comparable i)
Checks to see if this interval contains the given element. |
boolean |
contains(Interval other)
Checks to see if the other interval is a subset of this one. |
boolean |
contains(java.util.Set s)
Checks to see if this contains all elements of the set. |
java.lang.Comparable |
getEnd()
Gets the end of the interval, which is not an element of the interval. |
java.lang.Comparable |
getStart()
Gets the start of the interval. |
boolean |
intersects(Interval other)
Tests to see that the two intervals have some shared element(s). |
boolean |
intersects(java.util.Set s)
Tests to see if any elements of the set are elements of the interval. |
boolean |
isEmpty()
Tests to see if an object exists that this Interval contains. |
| Method Detail |
public java.lang.Comparable getStart()
public java.lang.Comparable getEnd()
public boolean isEmpty()
true if the interval is non-emptypublic boolean intersects(java.util.Set s)
s - set of Comparable objects to the interval, or other
Intervals.
public boolean intersects(Interval other)
other - the interval to check against
public boolean contains(java.lang.Comparable i)
i -
public boolean contains(Interval other)
other - the interval to check
public boolean contains(java.util.Set s)
s - the set to test
public Interval change(java.lang.Comparable start,
java.lang.Comparable stop)
start - the first elementstop - the element after the last elment; all elements
of the interval are strictly less than this.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||