public class LineCursor extends AbstractPollingCursor<String>
| Constructor and Description |
|---|
LineCursor(BufferedReader in)
Construct a cursor reading lines from a buffered reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
No-op implementation of the
Cursor.close() method. |
int |
getLineNumber()
Return the number of the line returned by the last call to
AbstractPollingCursor.next(). |
static LineCursor |
openFile(File file)
Open a delimited text cursor as a file.
|
static LineCursor |
openFile(File file,
CompressionMode comp)
Open a delimited text cursor as a file.
|
String |
poll()
Return the next element in this Cursor, or null if there are no more
elements.
|
copy, fastNext, hasNext, nextfast, getRowCount, iteratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic LineCursor(@WillCloseWhenClosed @Nonnull BufferedReader in)
in - The input reader.public static LineCursor openFile(File file) throws FileNotFoundException
file - The file to open.FileNotFoundException - if there is an error opening the file.public static LineCursor openFile(File file, CompressionMode comp) throws IOException
file - The file to open.FileNotFoundException - if there is an error opening the file.IOExceptionpublic String poll()
AbstractPollingCursorAbstractPollingCursor.copy(Object) copies objects. If this
method returns a fresh object every time, then AbstractPollingCursor.copy(Object)
should be a no-op.poll in class AbstractPollingCursor<String>public int getLineNumber()
AbstractPollingCursor.next().public void close()
AbstractCursorCursor.close() method.close in interface Closeableclose in interface AutoCloseableclose in interface Cursor<String>close in class AbstractCursor<String>