T
- The type of elements yielded by this iterator.public abstract class SimpleIterator<T> extends ReadOnlyIterator<T>
Iterator
interface, by requiring only
one method, nextIfAvailable()
, to be implemented instead of both
hasNext()
and next()
.
In addition, implementations are free to throw any exception, which,
if is a checked exception, will be rethrown wrapped in a RuntimeException
.nextIfAvailable()
Constructor and Description |
---|
SimpleIterator() |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
T |
next() |
protected abstract Optional<? extends T> |
nextIfAvailable() |
remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
Copyright © 2016. All Rights Reserved.