Package gnu.lists

Class ExtSequence<E>

java.lang.Object
gnu.lists.AbstractSequence<E>
gnu.lists.ExtSequence<E>
Direct Known Subclasses:
LList

public abstract class ExtSequence<E> extends AbstractSequence<E>
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.
  • Constructor Details

    • ExtSequence

      public ExtSequence()
  • Method Details

    • copyPos

      public int copyPos(int ipos)
      Description copied from class: AbstractSequence
      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.
      Overrides:
      copyPos in class AbstractSequence<E>
      Parameters:
      ipos - the position being copied.
      Returns:
      the new position
    • releasePos

      protected void releasePos(int ipos)
      Description copied from class: AbstractSequence
      Reclaim any resources used by the given position int.
      Overrides:
      releasePos in class AbstractSequence<E>
      Parameters:
      ipos - the Pos being free'd.
    • isAfterPos

      protected boolean isAfterPos(int ipos)
      Description copied from class: AbstractSequence
      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?
      Overrides:
      isAfterPos in class AbstractSequence<E>
    • nextIndex

      protected int nextIndex(int ipos)
      Description copied from class: AbstractSequence
      Get the offset from the beginning corresponding to a position cookie.
      Overrides:
      nextIndex in class AbstractSequence<E>