public class GapVector extends AbstractSequence implements Sequence
Modifier and Type | Field and Description |
---|---|
SimpleVector |
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 base) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Object o)
See java.util.List.
|
protected int |
addPos(int ipos,
java.lang.Object 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(java.lang.Object value) |
void |
fillPosRange(int fromPos,
int toPos,
java.lang.Object 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.
|
java.lang.Object |
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.
|
java.lang.Object |
set(int index,
java.lang.Object value)
See java.util.List.
|
protected void |
shiftGap(int newGapStart) |
int |
size()
See java.util.List.
|
add, addAll, addAll, clear, compare, compare, compare, 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, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, subList, toArray, toArray
consume
public SimpleVector base
public int gapStart
public int gapEnd
public GapVector(SimpleVector base)
protected GapVector()
public int size()
AbstractSequence
size
in interface Sequence
size
in interface java.util.Collection
size
in interface java.util.List
size
in class AbstractSequence
public boolean hasNext(int ipos)
hasNext
in class AbstractSequence
public int getNextKind(int ipos)
getNextKind
in class AbstractSequence
public java.lang.Object get(int index)
AbstractSequence
get
in interface Sequence
get
in interface java.util.List
get
in class AbstractSequence
public java.lang.Object set(int index, java.lang.Object value)
Sequence
set
in interface Sequence
set
in interface java.util.List
set
in class AbstractSequence
public void fill(java.lang.Object value)
fill
in interface Sequence
fill
in class AbstractSequence
public void fillPosRange(int fromPos, int toPos, java.lang.Object value)
fillPosRange
in class AbstractSequence
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, java.lang.Object value)
AbstractSequence
addPos
in class AbstractSequence
public void add(int index, java.lang.Object o)
AbstractSequence
add
in interface java.util.List
add
in class AbstractSequence
protected void removePosRange(int ipos0, int ipos1)
AbstractSequence
removePosRange
in class AbstractSequence
ipos0
- start of range, as a poistionipos1
- end of rangepublic int createPos(int index, boolean isAfter)
AbstractSequence
createPos
in class AbstractSequence
index
- offset from beginning of desired positionisAfter
- should the position have the isAfter propertyprotected boolean isAfterPos(int ipos)
AbstractSequence
isAfterPos
in class AbstractSequence
protected int nextIndex(int ipos)
AbstractSequence
nextIndex
in class AbstractSequence
public void consumePosRange(int iposStart, int iposEnd, Consumer out)
consumePosRange
in class AbstractSequence