Class LineReadingIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<String>,CloseableIterator<String>
public class LineReadingIterator
extends LookaheadIterator<String>
implements CloseableIterator<String>
Utility class providing an Iterator interface over line-oriented
text input, as a thin wrapper over a BufferedReader.
- Author:
- gojomo
-
Field Summary
FieldsFields inherited from class org.archive.util.iterator.LookaheadIterator
next -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.archive.util.iterator.LookaheadIterator
hasNext, next, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Field Details
-
reader
-
-
Constructor Details
-
LineReadingIterator
-
-
Method Details
-
lookahead
protected boolean lookahead()Loads next line into lookahead spot- Specified by:
lookaheadin classLookaheadIterator<String>- Returns:
- whether any item was loaded into next field
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-