Package org.supercsv.io
Interface ITokenizer
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
AbstractTokenizer
,Tokenizer
The interface for tokenizers, which are responsible for reading the CSV file, line by line.
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the line number currently being tokenized (the first line is line 1).Returns the raw (untokenized) CSV row that was just read (which can potentially span multiple lines in the file).boolean
readColumns
(List<String> columns) Reads a CSV row into the supplied List of columns (which can potentially span multiple lines in the file).
-
Method Details
-
getLineNumber
int getLineNumber()Gets the line number currently being tokenized (the first line is line 1). This number increments at every line terminator as the data is read, i.e. it will be- 0, if
readColumns(List)
hasn't been called yet - 1, when the first line is being read/tokenized
- 2, when the second line is being read/tokenized
- Returns:
- the line number currently being tokenized
- 0, if
-
getUntokenizedRow
String getUntokenizedRow()Returns the raw (untokenized) CSV row that was just read (which can potentially span multiple lines in the file).- Returns:
- the raw (untokenized) CSV row that was just read
- Since:
- 2.0.0
-
readColumns
Reads a CSV row into the supplied List of columns (which can potentially span multiple lines in the file). The columns list is cleared as the first operation in the method. Any empty columns ("") will be added to the list as null.- Parameters:
columns
- the List of columns to read into- Returns:
- true if something was read, or false if EOF
- Throws:
IOException
- when an IOException occursNullPointerException
- if columns is nullSuperCsvException
- on errors in parsing the input- Since:
- 2.0.0 (was previously called readStringList)
-