E- the type of object returned by the iterator.
public interface Iterator<E>
Iteratoris used to sequence over a collection of objects. Conceptually, an iterator is always positioned between two elements of a collection. A fresh iterator is always positioned in front of the first element. If a collection has been changed since its creation, methods
hasNext()may throw a
ConcurrentModificationException. Iterators with this behavior are called fail-fast iterators.
|Modifier and Type||Method and Description|
Returns whether there are more elements to iterate, i.e.
Returns the next object in the iteration, i.e.
Removes the last object returned by
trueif there are more elements,
nextfrom the collection. This method can only be called once after