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>

public class ExtPosition<E,ESEQ extends AbstractSequence<E>> extends SeqPosition<E,ESEQ>
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.
  • 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 class SeqPosition<E,ESEQ extends AbstractSequence<E>>
    • setPos

      public void setPos(AbstractSequence seq, int ipos)
      Overrides:
      setPos in class SeqPosition<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 class SeqPosition<E,ESEQ extends AbstractSequence<E>>
    • release

      public void release()
      Overrides:
      release in class SeqPosition<E,ESEQ extends AbstractSequence<E>>