Class TreeList.TreeListIterator<E>
- java.lang.Object
-
- org.apache.commons.collections4.list.TreeList.TreeListIterator<E>
-
- All Implemented Interfaces:
java.util.Iterator<E>,java.util.ListIterator<E>,OrderedIterator<E>
static class TreeList.TreeListIterator<E> extends java.lang.Object implements java.util.ListIterator<E>, OrderedIterator<E>
A list iterator over the linked list.
-
-
Field Summary
Fields Modifier and Type Field Description private TreeList.AVLNode<E>currentCache of the last node that was returned bynext()orprevious().private intcurrentIndexThe index of the last node that was returned.private intexpectedModCountThe modification count that the list is expected to have.private TreeList.AVLNode<E>nextCache of the next node that will be returned bynext().private intnextIndexThe index of the next node to be returned.private TreeList<E>parentThe parent list
-
Constructor Summary
Constructors Modifier Constructor Description protectedTreeListIterator(TreeList<E> parent, int fromIndex)Create a ListIterator for a list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(E obj)protected voidcheckModCount()Checks the modification count of the list is the value that this object expects.booleanhasNext()booleanhasPrevious()Checks to see if there is a previous element that can be iterated to.Enext()intnextIndex()Eprevious()Gets the previous element from the container.intpreviousIndex()voidremove()voidset(E obj)
-
-
-
Field Detail
-
next
private TreeList.AVLNode<E> next
Cache of the next node that will be returned bynext().
-
nextIndex
private int nextIndex
The index of the next node to be returned.
-
current
private TreeList.AVLNode<E> current
Cache of the last node that was returned bynext()orprevious().
-
currentIndex
private int currentIndex
The index of the last node that was returned.
-
expectedModCount
private int expectedModCount
The modification count that the list is expected to have. If the list doesn't have this count, then aConcurrentModificationExceptionmay be thrown by the operations.
-
-
Method Detail
-
checkModCount
protected void checkModCount()
Checks the modification count of the list is the value that this object expects.- Throws:
java.util.ConcurrentModificationException- If the list's modification count isn't the value that was expected.
-
hasNext
public boolean hasNext()
-
next
public E next()
-
hasPrevious
public boolean hasPrevious()
Description copied from interface:OrderedIteratorChecks to see if there is a previous element that can be iterated to.- Specified by:
hasPreviousin interfacejava.util.ListIterator<E>- Specified by:
hasPreviousin interfaceOrderedIterator<E>- Returns:
trueif the iterator has a previous element
-
previous
public E previous()
Description copied from interface:OrderedIteratorGets the previous element from the container.- Specified by:
previousin interfacejava.util.ListIterator<E>- Specified by:
previousin interfaceOrderedIterator<E>- Returns:
- the previous element in the iteration
-
nextIndex
public int nextIndex()
- Specified by:
nextIndexin interfacejava.util.ListIterator<E>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndexin interfacejava.util.ListIterator<E>
-
remove
public void remove()
-
-