java.lang.Object
org.jgrapht.util.DoublyLinkedList.ListNodeIteratorImpl
- All Implemented Interfaces:
Iterator<E>,ListIterator<E>,DoublyLinkedList.ListNodeIterator<E>,DoublyLinkedList.NodeIterator<E>
- Enclosing class:
DoublyLinkedList<E>
private class DoublyLinkedList.ListNodeIteratorImpl
extends Object
implements DoublyLinkedList.ListNodeIterator<E>
An implementation of the
DoublyLinkedList.ListNodeIterator interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe number of modifications the list have had at the moment when this iterator was createdprivate DoublyLinkedList.ListNodeImpl<E> ListNode this iterator returned last.private DoublyLinkedList.ListNodeImpl<E> ListNode this iterator will return next.private intIndex in this list of the ListNode returned next. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateListNodeIteratorImpl(int startIndex) privateListNodeIteratorImpl(int startIndex, DoublyLinkedList.ListNodeImpl<E> startNode) -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate voidVerifies that the list structure hasn't been changed since the iteration startedbooleanhasNext()booleanintnextNode()Returns the nextDoublyLinkedList.ListNodein the list and advances the cursor position.intReturns the previousDoublyLinkedList.ListNodein the list and moves the cursor position backwards.voidremove()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jgrapht.util.DoublyLinkedList.ListNodeIterator
next, previousMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
nextIndex
private int nextIndexIndex in this list of the ListNode returned next. -
next
ListNode this iterator will return next. Null if this list is empty. -
last
ListNode this iterator returned last. -
expectedModCount
private int expectedModCountThe number of modifications the list have had at the moment when this iterator was created
-
-
Constructor Details
-
ListNodeIteratorImpl
private ListNodeIteratorImpl(int startIndex) -
ListNodeIteratorImpl
-
-
Method Details
-
hasNext
public boolean hasNext() -
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceListIterator<E>
-
nextIndex
public int nextIndex()- Specified by:
nextIndexin interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndexin interfaceListIterator<E>
-
nextNode
Returns the nextDoublyLinkedList.ListNodein the list and advances the cursor position.- Specified by:
nextNodein interfaceDoublyLinkedList.NodeIterator<E>- Returns:
- the next
ListNode - See Also:
-
previousNode
Returns the previousDoublyLinkedList.ListNodein the list and moves the cursor position backwards.- Specified by:
previousNodein interfaceDoublyLinkedList.ListNodeIterator<E>- Returns:
- the previous
ListNode - See Also:
-
add
- Specified by:
addin interfaceListIterator<E>
-
set
- Specified by:
setin interfaceListIterator<E>
-
remove
public void remove() -
checkForComodification
private void checkForComodification()Verifies that the list structure hasn't been changed since the iteration started
-