T - Type of records returned by the reader.public abstract class AbstractBoundedReaderIterator<T> extends Reader.AbstractReaderIterator<T>
Provides basic treatment of hasNext()/next() to simplify implementations (e.g. ensuring hasNext() is called only once and verifying hasNext() in next()) and default no-op implementations of other operations.
This class is intended for internal usage. Users of Dataflow must not subclass it.
| Constructor and Description |
|---|
AbstractBoundedReaderIterator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns whether the source has any more elements.
|
protected abstract boolean |
hasNextImpl() |
T |
next()
Returns the next element.
|
protected abstract T |
nextImpl() |
close, copy, getProgress, requestDynamicSplitpublic final boolean hasNext()
throws IOException
Reader.ReaderIteratorIOExceptionprotected abstract boolean hasNextImpl()
throws IOException
IOExceptionpublic final T next() throws IOException, NoSuchElementException
Reader.ReaderIteratorIOException - if attempting to access an element involves IO that failsNoSuchElementException - if there are no more elementsprotected abstract T nextImpl() throws IOException
IOException