Class DoublyLinkedList.ListNodeIteratorImpl

    • Field Detail

      • nextIndex

        private int nextIndex
        Index in this list of the ListNode returned next.
      • expectedModCount

        private int expectedModCount
        The number of modifications the list have had at the moment when this iterator was created
    • Constructor Detail

      • ListNodeIteratorImpl

        private ListNodeIteratorImpl​(int startIndex)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<E>
        Specified by:
        hasNext in interface java.util.ListIterator<E>
      • hasPrevious

        public boolean hasPrevious()
        Specified by:
        hasPrevious in interface java.util.ListIterator<E>
      • nextIndex

        public int nextIndex()
        Specified by:
        nextIndex in interface java.util.ListIterator<E>
      • previousIndex

        public int previousIndex()
        Specified by:
        previousIndex in interface java.util.ListIterator<E>
      • add

        public void add​(E e)
        Specified by:
        add in interface java.util.ListIterator<E>
      • set

        public void set​(E e)
        Specified by:
        set in interface java.util.ListIterator<E>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<E>
        Specified by:
        remove in interface java.util.ListIterator<E>
      • checkForComodification

        private void checkForComodification()
        Verifies that the list structure hasn't been changed since the iteration started