public class StableVector extends GapVector
| Modifier and Type | Field and Description |
|---|---|
protected int |
free
The head of the free elements in position, if they are chained.
|
protected static int |
FREE_POSITION
An invalid value for an in-use element of positions.
|
protected int[] |
positions
This array maps from the exported ipos values (indexes in the positions
array) to the ipos of the underlying SimpleVector base.
|
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 |
StableVector() |
|
StableVector(SimpleVector base) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
addPos(int ipos,
java.lang.Object value)
Add a value at a specified Pos.
|
protected void |
adjustPositions(int low,
int high,
int delta)
Add a delta to all positions elements that point into a given range.
|
protected int |
allocPositionIndex() |
protected void |
chainFreelist()
Put all free elements in positions in a chain starting with free.
|
void |
consumePosRange(int iposStart,
int iposEnd,
Consumer out) |
int |
copyPos(int ipos)
Make a copy of a position int.
|
int |
createPos(int index,
boolean isAfter)
Generate a position at a given index.
|
int |
endPos() |
void |
fillPosRange(int fromPos,
int toPos,
java.lang.Object value) |
protected void |
gapReserve(int where,
int needed)
Adjust gap to 'where', and make sure it is least `needed'
elements long.
|
boolean |
hasNext(int ipos) |
protected boolean |
isAfterPos(int ipos)
Tests whether the position has the "isAfter" property.
|
int |
nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
|
int |
nextPos(int ipos)
Return the next position following the argument.
|
void |
releasePos(int ipos)
Reclaim any resources used by the given position int.
|
protected void |
removePosRange(int ipos0,
int ipos1)
Remove a range where each end-point is a position in a container.
|
protected void |
shiftGap(int newGapStart) |
int |
startPos() |
protected void |
unchainFreelist()
Set all free elements in positions to FREE_POSITION.
|
add, fill, gapReserve, get, getNextKind, getSegment, set, sizeadd, addAll, addAll, clear, compare, compare, compare, consume, consume, consumeNext, contains, containsAll, createRelativePos, elements, 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, parentPos, previousPos, rank, remove, remove, removeAll, removePos, retainAll, set, setPosNext, setPosPrevious, stableCompare, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedExceptionclone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArrayconsumeprotected int[] positions
protected int free
protected static final int FREE_POSITION
public StableVector(SimpleVector base)
protected StableVector()
protected void chainFreelist()
protected void unchainFreelist()
public int startPos()
startPos in class AbstractSequencepublic int endPos()
endPos in class AbstractSequenceprotected int allocPositionIndex()
public int createPos(int index,
boolean isAfter)
AbstractSequenceprotected boolean isAfterPos(int ipos)
AbstractSequenceisAfterPos in class GapVectorpublic int nextPos(int ipos)
AbstractSequencenextPos in class AbstractSequencepublic int nextIndex(int ipos)
AbstractSequencepublic void releasePos(int ipos)
AbstractSequencereleasePos in class AbstractSequenceipos - the Pos being free'd.public int copyPos(int ipos)
AbstractSequencecopyPos in class AbstractSequenceipos - the position being copied.public void fillPosRange(int fromPos,
int toPos,
java.lang.Object value)
fillPosRange in class GapVectorprotected void gapReserve(int where,
int needed)
gapReserve in class GapVectorprotected void adjustPositions(int low,
int high,
int delta)
x==positions[i], then if
(unsigned)x>=(unsigned)low && (unsigned)x <= (unsigned)high,
then add delta to positions[i].
Using unsigned comparisons allows us to compare ipos values,
which include both the index and the isAfter low-order bit.protected int addPos(int ipos,
java.lang.Object value)
AbstractSequenceprotected void removePosRange(int ipos0,
int ipos1)
AbstractSequenceremovePosRange in class GapVectoripos0 - start of range, as a poistionipos1 - end of rangepublic void consumePosRange(int iposStart,
int iposEnd,
Consumer out)
consumePosRange in class GapVector