public abstract class Iterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
Constructor and Description |
---|
Iterator() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
hasNext()
Returns whether there are more elements to iterate, i.e.
|
abstract E |
next()
Returns the next object in the iteration, i.e.
|
abstract void |
remove()
Removes the last object returned by
next from the collection. |
public abstract boolean hasNext()
public abstract E next()
public abstract void remove()
next
from the collection.
This method can only be called once after next
was called.remove
in interface java.util.Iterator<E>
java.lang.UnsupportedOperationException
- if removing is not supported by the collection being
iterated.java.lang.IllegalStateException
- if next
has not been called, or remove
has
already been called after the last call to next
.