|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLinkedListIterator<T>
public class LinkedListIterator<T>
The iterator implementation for LinkedList. The constructor for this class requires that a reference to a Listnode with the first data item is passed in. If the Listnode reference used to create the LinkedListIterator is null, that implies there is no data in the LinkedList and this iterator should handle that case correctly. COMPLETE THIS CLASS AND HAND IN THIS FILE
Constructor Summary | |
---|---|
LinkedListIterator(Listnode<T> head)
Constructs a LinkedListIterator when given the first node in a chain of nodes that contains data. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if their are no more data items to iterate through for this list. |
T |
next()
Returns the next element in the iteration and then advances the iteration reference. |
void |
remove()
The remove operation is not supported by this iterator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinkedListIterator(Listnode<T> head)
a
- reference to a List node that is a "header node".
The "header node" does not have a data reference.Method Detail |
---|
public T next()
next
in interface java.util.Iterator<T>
java.util.NoSuchElementException
- if the iteration has no more elementspublic boolean hasNext()
hasNext
in interface java.util.Iterator<T>
public void remove()
remove
in interface java.util.Iterator<T>
java.lang.UnsupportedOperationException
- if the remove operation is not
supported by this iterator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |