Package gnu.lists
Class ExtPosition<E,ESEQ extends AbstractSequence<E>>
java.lang.Object
gnu.lists.SeqPosition<E,ESEQ>
gnu.lists.ExtPosition<E,ESEQ>
- All Implemented Interfaces:
Enumeration<E>
,Iterator<E>
,ListIterator<E>
A SeqPosition for sequences that need more than a Pos int for a position.
For such sequences, a Pos int is an index into a PositionManager,
which manages a table of ExtPositions, which may contain more state
than a regular SeqPosition does.
-
Field Summary
Fields inherited from class gnu.lists.SeqPosition
ipos, sequence
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getPos()
Get a position int "cookie" for this SeqPosition.final boolean
isAfter()
Tests whether the position pair has the "isAfter" property.void
release()
void
setPos
(AbstractSequence seq, int ipos) Methods inherited from class gnu.lists.SeqPosition
add, copy, finalize, fromEndIndex, getContainingSequenceSize, getNext, getNextKind, getNextTypeName, getNextTypeObject, getPrevious, gotoChildrenStart, gotoEnd, gotoNext, gotoPrevious, gotoStart, hasMoreElements, hasNext, hasPrevious, make, next, nextElement, nextIndex, previous, previousIndex, remove, set, set, set, setNext, setPos, setPrevious, toInfo, toString
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Enumeration
asIterator
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ExtPosition
public ExtPosition()
-
-
Method Details
-
getPos
public int getPos()Description copied from class:SeqPosition
Get a position int "cookie" for this SeqPosition. The result can be passed to AbstractSequence's getPosNext(int), createRelativePos, and other methods. By default this is the value of ipos, but for sequences that need emore state than an ipos for efficient position, we use a PositionManager index. So this gets over-ridden in ExtPosition.- Overrides:
getPos
in classSeqPosition<E,
ESEQ extends AbstractSequence<E>>
-
setPos
- Overrides:
setPos
in classSeqPosition<E,
ESEQ extends AbstractSequence<E>>
-
isAfter
public final boolean isAfter()Description copied from class:SeqPosition
Tests whether the position pair has the "isAfter" property. I.e. if something is inserted at the position, will the iterator end up being after the new data? A toNext() or next() command should set isAfter() to true; a toPrevious or previous command should set isAfter() to false.- Overrides:
isAfter
in classSeqPosition<E,
ESEQ extends AbstractSequence<E>>
-
release
public void release()- Overrides:
release
in classSeqPosition<E,
ESEQ extends AbstractSequence<E>>
-