|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A list of items that is indexed not by integers but by Comparable objects.
| Nested Class Summary | |
static interface |
IntervalIndexList.Change
Function object interface for the map method of the list. |
| Method Summary | |
boolean |
addAll(IntervalIndexList l)
Adds all the elements from the given list at their specified locations |
void |
clear()
Removes all elements from the list. |
java.lang.Comparable |
endOf(java.lang.Comparable c)
Gets the end of the element in which c is contained. |
java.lang.Comparable |
firstAfter(java.lang.Comparable c)
Gets the start of the first element that begins strictly after c. |
java.lang.Comparable |
firstAfterOrAt(java.lang.Comparable c)
Gets the start of the first element that begins at c or after it. |
java.lang.Comparable |
firstBefore(java.lang.Comparable c)
Gets the start of the first element before c, exclusive. |
java.lang.Object |
get(java.lang.Comparable index)
Get the value at the specified index in the list. |
int |
getContiguousIntervalCount()
Gets a count of the contiguous (and homogenous, for those sort of things) intervals in the list. |
boolean |
isEmpty()
True if no elements are described in the list. |
java.util.Iterator |
iterator()
Gets an iterator over all the Interval objects here. |
java.util.Iterator |
iterator(Interval i)
Gets an iterator over all the Interval objects that intersect the given Interval. |
void |
map(IntervalIndexList.Change c)
Changes all the values of the elements by the given change function object. |
boolean |
remove(java.lang.Comparable start,
java.lang.Comparable stop)
Removes all values at the given range. |
void |
set(java.lang.Comparable start,
java.lang.Comparable stop,
java.lang.Object value)
Sets the value at the given range. |
IntervalIndexList |
subList(java.lang.Comparable start,
java.lang.Comparable stop)
Gets the sublist in the given interval |
| Method Detail |
public java.lang.Object get(java.lang.Comparable index)
index - the index into the list
public void set(java.lang.Comparable start,
java.lang.Comparable stop,
java.lang.Object value)
SortedMap, this means that value is set in the
range from start, inclusive, to stop, exclusive.
start - the first index to setstop - the first index that is not setvalue - all elements in the list in the range [start, stop)
will take this value
java.lang.IllegalArgumentException - if start is not less than stop
public boolean remove(java.lang.Comparable start,
java.lang.Comparable stop)
SortedMap, this means that value is set in the
range from start, inclusive, to stop, exclusive.
start - the first index to removestop - the first index that is not removed
true if any elements were removedpublic java.util.Iterator iterator()
public java.util.Iterator iterator(Interval i)
public boolean addAll(IntervalIndexList l)
l - the list to add
public IntervalIndexList subList(java.lang.Comparable start,
java.lang.Comparable stop)
start - the start of the chop, inclusivestop - the end of the chop, exclusive
public java.lang.Comparable firstBefore(java.lang.Comparable c)
c - Where to start looking backwards from
null if none foundpublic java.lang.Comparable firstAfterOrAt(java.lang.Comparable c)
c - the place to start looking
null if none foundpublic java.lang.Comparable firstAfter(java.lang.Comparable c)
c - the place to start looking
null if none foundpublic java.lang.Comparable endOf(java.lang.Comparable c)
c - the element to check
null if c isn't within an interval
described by this listpublic void clear()
public boolean isEmpty()
!iterator().hasNext()public void map(IntervalIndexList.Change c)
c - the method to apply to all elementspublic int getContiguousIntervalCount()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||