|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.RangeSelection
public class RangeSelection
Class for managing a set of indexed range selections.
Constructor Summary | |
---|---|
RangeSelection()
|
Method Summary | |
---|---|
Sequence<Span> |
addRange(int start,
int end)
Adds a range to the selection, merging and removing intersecting ranges as needed. |
void |
clear()
Clears the selection. |
boolean |
containsIndex(int index)
Tests for the presence of an index in the selection. |
Span |
get(int index)
Returns the range at a given index. |
int |
getLength()
Returns the number of ranges in the selection. |
ImmutableList<Span> |
getSelectedRanges()
Returns an immutable wrapper around the selected ranges. |
int |
indexOf(Span range)
Determines the index of a range in the selection. |
int |
insertIndex(int index)
Inserts an index into the span sequence (e.g. when items are inserted into the model data). |
static Span |
normalize(int start,
int end)
Ensures that the start value is less than or equal to the end value. |
int |
removeIndexes(int index,
int count)
Removes a range of indexes from the span sequence (e.g. when items are removed from the model data). |
Sequence<Span> |
removeRange(int start,
int end)
Removes a range from the selection, truncating and removing intersecting ranges as needed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RangeSelection()
Method Detail |
---|
public Sequence<Span> addRange(int start, int end)
start
- end
-
public Sequence<Span> removeRange(int start, int end)
start
- end
-
public void clear()
public Span get(int index)
index
- public int getLength()
public ImmutableList<Span> getSelectedRanges()
public int indexOf(Span range)
range
-
public boolean containsIndex(int index)
index
-
public int insertIndex(int index)
index
-
public int removeIndexes(int index, int count)
index
- count
-
public static Span normalize(int start, int end)
start
- end
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |