Package gnu.lists

Class SubSequence<E>

    • Constructor Detail

      • SubSequence

        public SubSequence()
      • SubSequence

        public SubSequence​(AbstractSequence<E> base,
                           int startPos,
                           int endPos)
    • Method Detail

      • removePosRange

        public void removePosRange​(int istart,
                                   int iend)
        Description copied from class: AbstractSequence
        Remove a range where each end-point is a position in a container.
        Overrides:
        removePosRange in class AbstractSequence<E>
        Parameters:
        istart - start of range, as a poistion
        iend - end of range
      • 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>
      • createPos

        public int createPos​(int offset,
                             boolean isAfter)
        Description copied from class: AbstractSequence
        Generate a position at a given index. The result is a position cookie that must be free'd with releasePos.
        Overrides:
        createPos in class AbstractSequence<E>
        Parameters:
        offset - offset from beginning of desired position
        isAfter - should the position have the isAfter property
      • releasePos

        public 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.
      • 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>
      • compare

        public int compare​(int ipos1,
                           int ipos2)
        Description copied from class: AbstractSequence
        Compare two positions, and indicate their relative order.
        Overrides:
        compare in class AbstractSequence<E>
      • getPosNext

        public Object getPosNext​(int ipos)
        Description copied from class: AbstractSequence
        Get the element following the specified position.
        Overrides:
        getPosNext in class AbstractSequence<E>
        Parameters:
        ipos - the specified position.
        Returns:
        the following element, or eofValue if there is none. Called by SeqPosition.getNext. FIXME Should change eof handling so return type can be E.
      • getPosPrevious

        public Object getPosPrevious​(int ipos)
        Description copied from class: AbstractSequence
        Get the element before the specified position.
        Overrides:
        getPosPrevious in class AbstractSequence<E>
        Parameters:
        ipos - the specified position.
        Returns:
        the following element, or eofValue if there is none. FIXME Should change eof handling so return type can be E.
      • finalize

        public void finalize()
        Overrides:
        finalize in class Object