Package org.gbif.utils.file.tabular
Interface TabularDataFileReader<T>
- All Superinterfaces:
AutoCloseable,Closeable
Interface defining a reader for tabular data file (e.g. CSV)
-
Method Summary
-
Method Details
-
getHeaderLine
Get the header line of the tabular data file (if possible).- Returns:
- headers or null
- Throws:
IOException
-
read
Read a non-empty line of the tabular data file. An empty line represents a line with no printable characters. A line with only the defined separators is expected to be returned.- Returns:
- the next line of the tabular data file or null if the end of the file is reached.
- Throws:
IOExceptionParseException
-
getLastRecordLineNumber
long getLastRecordLineNumber()The line number of where the last record returned byread()starts. If no records have been returned yet this method is expected to return 0. Onceread()returned null, this methods will return the number of the last line in the file. Note that if the very last line is an empty line with only an endline character it will not be counted. Line number includes header line and empty lines (if applicable).- Returns:
- line number of where the last record starts
-
getLastRecordNumber
long getLastRecordNumber()Represents the number of record returned by theread()method. If no records have been returned yet this method is expected to return 0. A record can span over multiple line.- Returns:
-