gnu.lists
Class ExtPosition

java.lang.Object
  extended by gnu.lists.SeqPosition
      extended by gnu.lists.ExtPosition
All Implemented Interfaces:
java.util.Enumeration, java.util.Iterator, java.util.ListIterator

public class ExtPosition
extends SeqPosition

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
ExtPosition()
           
 
Method Summary
 int getPos()
          Get a position int "cookie" for this SeqPosition.
 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
 

Constructor Detail

ExtPosition

public ExtPosition()
Method Detail

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 class SeqPosition

setPos

public void setPos(AbstractSequence seq,
                   int ipos)
Overrides:
setPos in class SeqPosition

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 class SeqPosition

release

public void release()
Overrides:
release in class SeqPosition