public class DelimitedTextCursor extends AbstractCursor<String[]>
| Constructor and Description |
|---|
DelimitedTextCursor(BufferedReader in,
Pattern delim)
Construct a cursor reading text from a scanner with a regex delimiter.
|
DelimitedTextCursor(BufferedReader in,
String delim)
Construct a cursor reading text from a scanner with a fixed delimiter.
|
DelimitedTextCursor(File file,
String delim)
Construct a delimited text cursor from a file.
|
| 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
next(). |
boolean |
hasNext()
Query whether the cursor has any more items.
|
String[] |
next()
Fetch the next item from the cursor.
|
fast, fastNext, getRowCount, iteratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic DelimitedTextCursor(@WillCloseWhenClosed @Nonnull BufferedReader in, @Nonnull Pattern delim)
in - The input scanner.delim - The delimiter.public DelimitedTextCursor(@WillCloseWhenClosed @Nonnull BufferedReader in, @Nonnull String delim)
in - The scanner to read from.delim - The delimiter string.public DelimitedTextCursor(File file, @Nonnull String delim) throws FileNotFoundException
file - The name of the file to read.delim - The delimiter.FileNotFoundException - if file is not found.public boolean hasNext()
Cursortrue if there remains another item to fetch.@Nonnull public String[] next()
Cursorpublic int getLineNumber()
next().public void close()
AbstractCursorCursor.close() method.close in interface Closeableclose in interface AutoCloseableclose in interface Cursor<String[]>close in class AbstractCursor<String[]>