Package com.opencsv.bean.concurrent
Class SingleLineReader
java.lang.Object
com.opencsv.bean.concurrent.SingleLineReader
- Direct Known Subclasses:
CompleteFileReader
This class exists to isolate the logic for reading a single line of input
that is common to
CsvToBean.iterator()
and CompleteFileReader
.
It is not meant for end user consumption.- Since:
- 5.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSingleLineReader
(CSVReader csvReader, boolean ignoreEmptyLines) The only constructor. -
Method Summary
Modifier and TypeMethodDescriptionString[]
getLine()
Returns a copy of the last line read byreadNextLine()
.long
private boolean
String[]
Reads from theCSVReader
provided on instantiation until a usable line of input is found.
-
Field Details
-
csvReader
-
ignoreEmptyLines
protected final boolean ignoreEmptyLines -
line
Stores the result of parsing a line of input.
-
-
Constructor Details
-
SingleLineReader
The only constructor.- Parameters:
csvReader
- TheCSVReader
for reading the inputignoreEmptyLines
- Whether blank lines of input should be ignored
-
-
Method Details
-
isCurrentLineEmpty
private boolean isCurrentLineEmpty() -
readNextLine
Reads from theCSVReader
provided on instantiation until a usable line of input is found.- Returns:
- The next line of significant input, or
null
if none remain - Throws:
IOException
- If bad things happen during the readCsvValidationException
- If a user-defined validator fails
-
getLinesRead
public long getLinesRead()- Returns:
- The number of lines read from the input this far
-
getLine
Returns a copy of the last line read byreadNextLine()
.- Returns:
- A new array with the last line read
-