Package gnu.lists

Class ExtPosition<E,​ESEQ extends AbstractSequence<E>>

  • 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 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<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>>