public class LinkedListIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>
Constructor and Description |
---|
LinkedListIterator(Listnode<T> head)
Constructs a LinkedListIterator when given the first node
with data for a chain of nodes.
|
Modifier and Type | Method and Description |
---|---|
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
|
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