gnu.lists
Class ExtSequence
public abstract class ExtSequence
Abstract helper class for Sequences that use an ExtPosition.
That is sequences where it is inefficient to represent a position
just using a Pos int.
int | copyPos(int ipos) - Make a copy of a position int.
|
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 | releasePos(int ipos) - Reclaim any resources used by the given position int.
|
add , add , addAll , addAll , addPos , clear , compare , compare , compare , consume , consumeNext , consumePosRange , contains , containsAll , copyPos , createPos , createRelativePos , elements , endPos , equals , equals , fill , fill , fillPosRange , firstAttributePos , firstChildPos , firstChildPos , fromEndIndex , get , get , getAttribute , getAttributeLength , getContainingSequenceSize , getEffectiveIndex , getIndexDifference , getIterator , getIterator , getIteratorAtPos , getLowBound , getNextKind , getNextTypeName , getNextTypeObject , getPosNext , getPosPrevious , getSize , gotoAttributesStart , gotoChildrenStart , gotoParent , hasNext , hasPrevious , hashCode , indexOf , isAfterPos , isEmpty , iterator , lastIndexOf , listIterator , listIterator , nextIndex , nextIndex , nextMatching , nextPos , parentPos , previousPos , rank , releasePos , remove , remove , removeAll , removePos , removePosRange , retainAll , set , set , setPosNext , setPosPrevious , size , stableCompare , startPos , subList , subSequence , subSequencePos , toArray , toArray , toString , toString , unsupported , unsupportedException |
copyPos
public int copyPos(int ipos)
Make a copy of a position int.
For simple positions returns the argument.
However, if the positions are magic cookies that are actively managed
by the sequence (as opposed to for example a simple index), then making
a copy may need to increment a reference count, or maybe allocate a
new position cookie. In any case, the new position is initialized to
the same offset (and isAfter property) as the original.
- copyPos in interface AbstractSequence
ipos
- the position being copied.
isAfterPos
protected boolean isAfterPos(int ipos)
Tests whether the position has the "isAfter" property.
I.e. if something is inserted at the position, will
the iterator end up being after the new data?
- isAfterPos in interface AbstractSequence
nextIndex
protected int nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
- nextIndex in interface AbstractSequence
releasePos
protected void releasePos(int ipos)
Reclaim any resources used by the given position int.
- releasePos in interface AbstractSequence
ipos
- the Pos being free'd.