|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.collections15.list.AbstractLinkedList.LinkedListIterator<T>
protected static class AbstractLinkedList.LinkedListIterator<T>
A list iterator over the linked list.
Field Summary | |
---|---|
protected AbstractLinkedList.Node<T> |
current
The last node that was returned by next() or previous() . |
protected int |
expectedModCount
The modification count that the list is expected to have. |
protected AbstractLinkedList.Node<T> |
next
The node that will be returned by next() . |
protected int |
nextIndex
The index of next . |
protected AbstractLinkedList<T> |
parent
The parent list |
Constructor Summary | |
---|---|
protected |
AbstractLinkedList.LinkedListIterator(AbstractLinkedList<T> parent,
int fromIndex)
Create a ListIterator for a list. |
Method Summary | |
---|---|
void |
add(T obj)
|
protected void |
checkModCount()
Checks the modification count of the list is the value that this object expects. |
protected AbstractLinkedList.Node<T> |
getLastNodeReturned()
Gets the last node returned. |
boolean |
hasNext()
|
boolean |
hasPrevious()
Checks to see if there is a previous element that can be iterated to. |
T |
next()
|
int |
nextIndex()
|
T |
previous()
Gets the previous element from the collection. |
int |
previousIndex()
|
void |
remove()
|
void |
set(T obj)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final AbstractLinkedList<T> parent
protected AbstractLinkedList.Node<T> next
next()
. If this is equal
to AbstractLinkedList.header
then there are no more values to return.
protected int nextIndex
next
.
protected AbstractLinkedList.Node<T> current
next()
or previous()
. Set to null
if next()
or previous()
haven't been called, or if the node has been removed
with remove()
or a new node added with add(Object)
.
Should be accessed through getLastNodeReturned()
to enforce
this behaviour.
protected int expectedModCount
ConcurrentModificationException
may be thrown by
the operations.
Constructor Detail |
---|
protected AbstractLinkedList.LinkedListIterator(AbstractLinkedList<T> parent, int fromIndex) throws java.lang.IndexOutOfBoundsException
parent
- the parent listfromIndex
- the index to start at
java.lang.IndexOutOfBoundsException
Method Detail |
---|
protected void checkModCount()
java.util.ConcurrentModificationException
- If the list's modification
count isn't the value that was expected.protected AbstractLinkedList.Node<T> getLastNodeReturned() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If next()
or
previous()
haven't been called, or if the node has been removed
with remove()
or a new node added with add(Object)
.public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
hasNext
in interface java.util.ListIterator<T>
public T next()
next
in interface java.util.Iterator<T>
next
in interface java.util.ListIterator<T>
public boolean hasPrevious()
OrderedIterator
hasPrevious
in interface java.util.ListIterator<T>
hasPrevious
in interface OrderedIterator<T>
true
if the iterator has a previous elementpublic T previous()
OrderedIterator
previous
in interface java.util.ListIterator<T>
previous
in interface OrderedIterator<T>
public int nextIndex()
nextIndex
in interface java.util.ListIterator<T>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<T>
public void remove()
remove
in interface java.util.Iterator<T>
remove
in interface java.util.ListIterator<T>
public void set(T obj)
set
in interface java.util.ListIterator<T>
public void add(T obj)
add
in interface java.util.ListIterator<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |