- java.lang.Object
-
- org.jgrapht.util.DoublyLinkedList.ListNodeIteratorImpl
-
- All Implemented Interfaces:
java.util.Iterator<E>,java.util.ListIterator<E>,DoublyLinkedList.ListNodeIterator<E>,DoublyLinkedList.NodeIterator<E>
- Enclosing class:
- DoublyLinkedList<E>
private class DoublyLinkedList.ListNodeIteratorImpl extends java.lang.Object implements DoublyLinkedList.ListNodeIterator<E>
An implementation of theDoublyLinkedList.ListNodeIteratorinterface.
-
-
Field Summary
Fields Modifier and Type Field Description private intexpectedModCountThe number of modifications the list have had at the moment when this iterator was createdprivate DoublyLinkedList.ListNodeImpl<E>lastListNode this iterator returned last.private DoublyLinkedList.ListNodeImpl<E>nextListNode this iterator will return next.private intnextIndexIndex in this list of the ListNode returned next.
-
Constructor Summary
Constructors Modifier Constructor Description privateListNodeIteratorImpl(int startIndex)privateListNodeIteratorImpl(int startIndex, DoublyLinkedList.ListNodeImpl<E> startNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(E e)private voidcheckForComodification()Verifies that the list structure hasn't been changed since the iteration startedbooleanhasNext()booleanhasPrevious()intnextIndex()DoublyLinkedList.ListNodeImpl<E>nextNode()Returns the nextDoublyLinkedList.ListNodein the list and advances the cursor position.intpreviousIndex()DoublyLinkedList.ListNode<E>previousNode()Returns the previousDoublyLinkedList.ListNodein the list and moves the cursor position backwards.voidremove()voidset(E e)-
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
-
-
-
-
Field Detail
-
nextIndex
private int nextIndex
Index in this list of the ListNode returned next.
-
next
private DoublyLinkedList.ListNodeImpl<E> next
ListNode this iterator will return next. Null if this list is empty.
-
last
private DoublyLinkedList.ListNodeImpl<E> last
ListNode this iterator returned last.
-
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)
-
ListNodeIteratorImpl
private ListNodeIteratorImpl(int startIndex, DoublyLinkedList.ListNodeImpl<E> startNode)
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPreviousin interfacejava.util.ListIterator<E>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndexin interfacejava.util.ListIterator<E>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndexin interfacejava.util.ListIterator<E>
-
nextNode
public DoublyLinkedList.ListNodeImpl<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:
ListIterator.next()
-
previousNode
public DoublyLinkedList.ListNode<E> 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:
ListIterator.previous()
-
remove
public void remove()
-
checkForComodification
private void checkForComodification()
Verifies that the list structure hasn't been changed since the iteration started
-
-