|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.LinkedList.ListIterator | +--com.mhhe.clrs2e.LinearDLL.LinearDLLIterator
Inner class for an iterator.
Field Summary | |
private LinkedList.Node |
current
A reference to the Node returned by the most
recent call to next . |
Constructor Summary | |
LinearDLL.LinearDLLIterator()
Starts an iteration. |
Method Summary | |
boolean |
hasNext()
Returns true if this iterator has more
elements, false otherwise. |
java.lang.Object |
next()
Returns the next element in the iteration. |
void |
remove()
Removes the last element returned by the iterator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private LinkedList.Node current
Node
returned by the most
recent call to next
. Initially, it is
null
.
Constructor Detail |
public LinearDLL.LinearDLLIterator()
Method Detail |
public boolean hasNext()
true
if this iterator has more
elements, false
otherwise.
hasNext
in interface java.util.Iterator
hasNext
in class LinkedList.ListIterator
public java.lang.Object next()
next
in interface java.util.Iterator
next
in class LinkedList.ListIterator
public void remove()
remove
in interface java.util.Iterator
remove
in class LinkedList.ListIterator
java.lang.IllegalStateException
- if next
has not
been called.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |