public class GapVector<E> extends AbstractSequence<E> implements Sequence<E>
Modifier and Type | Field and Description |
---|---|
SimpleVector<E> |
base |
int |
gapEnd |
int |
gapStart |
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
Modifier | Constructor and Description |
---|---|
protected |
GapVector() |
|
GapVector(SimpleVector<E> base) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
E o)
See java.util.List.
|
protected int |
addPos(int ipos,
E value)
Add a value at a specified Pos.
|
void |
consumePosRange(int iposStart,
int iposEnd,
Consumer out) |
int |
createPos(int index,
boolean isAfter)
Generate a position at a given index.
|
void |
fill(E value) |
void |
fillPosRange(int fromPos,
int toPos,
E value) |
protected void |
gapReserve(int size)
Make sure gap is at least 'size' elements long.
|
protected void |
gapReserve(int where,
int needed)
Adjust gap to 'where', and make sure it is least `needed'
elements long.
|
E |
get(int index)
See java.util.List.
|
int |
getNextKind(int ipos) |
int |
getSegment(int where,
int len)
If needed, move the gap so the given segment is contiguous.
|
boolean |
hasNext(int ipos) |
protected boolean |
isAfterPos(int ipos)
Tests whether the position has the "isAfter" property.
|
protected int |
nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
|
protected void |
removePosRange(int ipos0,
int ipos1)
Remove a range where each end-point is a position in a container.
|
E |
set(int index,
E value)
See java.util.List.
|
protected void |
shiftGap(int newGapStart) |
int |
size()
See java.util.List.
|
add, addAll, addAll, clear, compare, compare, compare, consume, consume, consumeNext, contains, containsAll, copyPos, createRelativePos, elements, endPos, equals, equals, fill, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasPrevious, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, retainAll, set, setPosNext, setPosPrevious, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedException
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
consume
public SimpleVector<E> base
public int gapStart
public int gapEnd
public GapVector(SimpleVector<E> base)
protected GapVector()
public int size()
AbstractSequence
public boolean hasNext(int ipos)
hasNext
in class AbstractSequence<E>
public int getNextKind(int ipos)
getNextKind
in class AbstractSequence<E>
public E get(int index)
AbstractSequence
public E set(int index, E value)
Sequence
public void fill(E value)
public void fillPosRange(int fromPos, int toPos, E value)
fillPosRange
in class AbstractSequence<E>
protected void shiftGap(int newGapStart)
protected final void gapReserve(int size)
protected void gapReserve(int where, int needed)
public int getSegment(int where, int len)
protected int addPos(int ipos, E value)
AbstractSequence
addPos
in class AbstractSequence<E>
public void add(int index, E o)
AbstractSequence
add
in interface java.util.List<E>
add
in class AbstractSequence<E>
protected void removePosRange(int ipos0, int ipos1)
AbstractSequence
removePosRange
in class AbstractSequence<E>
ipos0
- start of range, as a poistionipos1
- end of rangepublic int createPos(int index, boolean isAfter)
AbstractSequence
createPos
in class AbstractSequence<E>
index
- offset from beginning of desired positionisAfter
- should the position have the isAfter propertyprotected boolean isAfterPos(int ipos)
AbstractSequence
isAfterPos
in class AbstractSequence<E>
protected int nextIndex(int ipos)
AbstractSequence
nextIndex
in class AbstractSequence<E>
public void consumePosRange(int iposStart, int iposEnd, Consumer out)
consumePosRange
in class AbstractSequence<E>