|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.wtk.SpanSequence
public class SpanSequence
Class representing a sequence of sorted, consolidated spans.
Nested Class Summary | |
---|---|
static class |
SpanSequence.SpanComparator
Determines the relative order of two spans. |
Nested classes/interfaces inherited from interface pivot.collections.Sequence |
---|
Sequence.Search, Sequence.Sort, Sequence.Tree |
Constructor Summary | |
---|---|
SpanSequence()
|
Method Summary | |
---|---|
int |
add(Span span)
Adds a span to the sequence, merging and removing intersecting spans as needed. |
void |
clear()
Removes all spans from the sequence. |
Span |
get(int index)
Retrieves the span at the given index. |
int |
getLength()
Returns the length of the sequence. |
int |
indexOf(Span span)
Returns the index of the first identified span that intersects with the given span, or a negative value representing the insertion point of the span as defined by the binary search algorithm. |
void |
insert(Span span,
int index)
Not supported. |
void |
insertIndex(int index)
Inserts an index into the span sequence. |
Sequence<Span> |
remove(int index,
int count)
Removes one or more spans from the sequence. |
int |
remove(Span span)
Removes a span from the sequence, truncating and removing intersecting spans as needed. |
void |
removeIndexes(int index,
int count)
Removes a range of indexes from the span sequence. |
Span |
update(int index,
Span span)
Not supported. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpanSequence()
Method Detail |
---|
public int add(Span span)
add
in interface Sequence<Span>
span
- The span to add to the sequence.
public final void insert(Span span, int index)
insert
in interface Sequence<Span>
span
- The item to be added to the sequence.index
- The index at which the item should be inserted. Must be a value between
0 and getLength().public final Span update(int index, Span span)
update
in interface Sequence<Span>
index
- The index of the item to update.span
- The item that will replace any existing value at the given index.
public int remove(Span span)
remove
in interface Sequence<Span>
span
- The span to remove from the sequence.
Sequence.remove(int, int)
public Sequence<Span> remove(int index, int count)
remove
in interface Sequence<Span>
index
- The starting index to remove.count
- The number of items to remove, beginning with index.
public void clear()
public Span get(int index)
get
in interface Sequence<Span>
index
- The index of the span to retrieve.public int indexOf(Span span)
indexOf
in interface Sequence<Span>
span
- The item to locate.
public int getLength()
getLength
in interface Sequence<Span>
public void insertIndex(int index)
index
- The index to insert.public void removeIndexes(int index, int count)
index
- The first index to remove.count
- The number of indexes to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |