static class TreeList.TreeListIterator extends java.lang.Object implements java.util.ListIterator, OrderedIterator
Modifier and Type | Field and Description |
---|---|
protected TreeList.AVLNode |
current
Cache of the last node that was returned by
next()
or previous() . |
protected int |
currentIndex
The index of the last node that was returned.
|
protected int |
expectedModCount
The modification count that the list is expected to have.
|
protected TreeList.AVLNode |
next
Cache of the next node that will be returned by
next() . |
protected int |
nextIndex
The index of the next node to be returned.
|
protected TreeList |
parent
The parent list
|
Modifier | Constructor and Description |
---|---|
protected |
TreeListIterator(TreeList parent,
int fromIndex)
Create a ListIterator for a list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object obj) |
protected void |
checkModCount()
Checks the modification count of the list is the value that this
object expects.
|
boolean |
hasNext() |
boolean |
hasPrevious()
Checks to see if there is a previous element that can be iterated to.
|
java.lang.Object |
next() |
int |
nextIndex() |
java.lang.Object |
previous()
Gets the previous element from the collection.
|
int |
previousIndex() |
void |
remove() |
void |
set(java.lang.Object obj) |
protected final TreeList parent
protected TreeList.AVLNode next
next()
.protected int nextIndex
protected TreeList.AVLNode current
next()
or previous()
.protected int currentIndex
protected int expectedModCount
ConcurrentModificationException
may be thrown by
the operations.protected TreeListIterator(TreeList parent, int fromIndex) throws java.lang.IndexOutOfBoundsException
parent
- the parent listfromIndex
- the index to start atjava.lang.IndexOutOfBoundsException
protected void checkModCount()
java.util.ConcurrentModificationException
- If the list's modification
count isn't the value that was expected.public boolean hasNext()
hasNext
in interface java.util.Iterator
hasNext
in interface java.util.ListIterator
public java.lang.Object next()
next
in interface java.util.Iterator
next
in interface java.util.ListIterator
public boolean hasPrevious()
OrderedIterator
hasPrevious
in interface java.util.ListIterator
hasPrevious
in interface OrderedIterator
true
if the iterator has a previous elementpublic java.lang.Object previous()
OrderedIterator
previous
in interface java.util.ListIterator
previous
in interface OrderedIterator
public int nextIndex()
nextIndex
in interface java.util.ListIterator
public int previousIndex()
previousIndex
in interface java.util.ListIterator
public void remove()
remove
in interface java.util.Iterator
remove
in interface java.util.ListIterator
public void set(java.lang.Object obj)
set
in interface java.util.ListIterator
public void add(java.lang.Object obj)
add
in interface java.util.ListIterator