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 int
The 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 int
Index in this list of the ListNode returned next. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ListNodeIteratorImpl
(int startIndex) private
ListNodeIteratorImpl
(int startIndex, DoublyLinkedList.ListNodeImpl<E> startNode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
private void
Verifies that the list structure hasn't been changed since the iteration startedboolean
hasNext()
boolean
int
nextNode()
Returns the nextDoublyLinkedList.ListNode
in the list and advances the cursor position.int
Returns the previousDoublyLinkedList.ListNode
in the list and moves the cursor position backwards.void
remove()
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jgrapht.util.DoublyLinkedList.ListNodeIterator
next, previous
Methods 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:
hasPrevious
in interfaceListIterator<E>
-
nextIndex
public int nextIndex()- Specified by:
nextIndex
in interfaceListIterator<E>
-
previousIndex
public int previousIndex()- Specified by:
previousIndex
in interfaceListIterator<E>
-
nextNode
Returns the nextDoublyLinkedList.ListNode
in the list and advances the cursor position.- Specified by:
nextNode
in interfaceDoublyLinkedList.NodeIterator<E>
- Returns:
- the next
ListNode
- See Also:
-
previousNode
Returns the previousDoublyLinkedList.ListNode
in the list and moves the cursor position backwards.- Specified by:
previousNode
in interfaceDoublyLinkedList.ListNodeIterator<E>
- Returns:
- the previous
ListNode
- See Also:
-
add
- Specified by:
add
in interfaceListIterator<E>
-
set
- Specified by:
set
in interfaceListIterator<E>
-
remove
public void remove() -
checkForComodification
private void checkForComodification()Verifies that the list structure hasn't been changed since the iteration started
-