Class CursorableLinkedList.SubCursor<E>

    • Constructor Detail

      • SubCursor

        protected SubCursor​(AbstractLinkedList.LinkedSubList<E> sub,
                            int index)
        Constructs a new cursor.
        Parameters:
        sub - the sub list
        index - the index to start from
    • Method Detail

      • add

        public void add​(E obj)
        Description copied from class: CursorableLinkedList.Cursor
        Adds an object to the list. The object added here will be the new 'previous' in the iterator.
        Specified by:
        add in interface java.util.ListIterator<E>
        Overrides:
        add in class CursorableLinkedList.Cursor<E>
        Parameters:
        obj - the object to add
      • remove

        public void remove()
        Description copied from class: CursorableLinkedList.Cursor
        Removes the item last returned by this iterator.

        There may have been subsequent alterations to the list since you obtained this item, however you can still remove it. You can even remove it if the item is no longer in the main list. However, you can't call this method on the same iterator more than once without calling next() or previous().

        Specified by:
        remove in interface java.util.Iterator<E>
        Specified by:
        remove in interface java.util.ListIterator<E>
        Overrides:
        remove in class CursorableLinkedList.Cursor<E>