|
|||||||||
| 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.SentinelDLL.SentinelDLLIterator
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 | |
SentinelDLL.SentinelDLLIterator()
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 the
sentinel.
| Constructor Detail |
public SentinelDLL.SentinelDLLIterator()
| Method Detail |
public boolean hasNext()
true if this iterator has more
elements, false otherwise.
hasNext in interface java.util.IteratorhasNext in class LinkedList.ListIteratorpublic java.lang.Object next()
next in interface java.util.Iteratornext in class LinkedList.ListIteratorpublic void remove()
remove in interface java.util.Iteratorremove in class LinkedList.ListIteratorjava.lang.IllegalStateException - if next has not
been called.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||