public interface Iterator
Similar to the standard Java Iterator, it will return a set of Objects sequentially. When hasNext() returns false, there are no more Objects to retrieve.
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns whether there are more Objects to retrieve.
|
Object |
next()
Returns the next Object in the sequence.
|
void |
remove()
Returns the next Object in the sequence (optional operation).
|
boolean hasNext()
Object next() throws NoSuchElementException
NoSuchElementException
- if there are no more elements left.void remove()
UnsupportedOperationException
- if the implementation does not support this operaton