public class CSVReader extends Object implements ClosableReportingIterator<String[]>
Modifier and Type | Field and Description |
---|---|
String |
delimiter |
String |
encoding |
String[] |
header |
int |
headerRows |
Character |
quoteChar |
Constructor and Description |
---|
CSVReader(File source,
String encoding,
String delimiter,
Character quotes,
Integer headerRows) |
CSVReader(InputStream stream,
String encoding,
String delimiter,
Character quotes,
Integer headerRows) |
CSVReader(InputStream stream,
String encoding,
String delimiter,
Character quotes,
Integer headerRows,
int emptyLineCache) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
currLineNumber() |
Set<Integer> |
getEmptyLines() |
String |
getErrorMessage()
Return an informative message about the error encountered while iterating over row.
|
Exception |
getException()
Return the Exception encountered while iterating over row.
|
String[] |
getHeader()
Get the header, or null if none
|
int |
getReadRows() |
boolean |
hasNext() |
boolean |
hasRowError()
Return true if an error was encountered while iterating over row.
|
String[] |
next() |
void |
remove() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public final int headerRows
public CSVReader(File source, String encoding, String delimiter, Character quotes, Integer headerRows) throws IOException
IOException
public CSVReader(InputStream stream, String encoding, String delimiter, Character quotes, Integer headerRows) throws IOException
IOException
public CSVReader(InputStream stream, String encoding, String delimiter, Character quotes, Integer headerRows, int emptyLineCache) throws IOException
IOException
public void close()
close
in interface AutoCloseable
public int currLineNumber()
public Set<Integer> getEmptyLines()
public int getReadRows()
public boolean hasRowError()
ClosableReportingIterator
hasRowError
in interface ClosableReportingIterator<String[]>
public String getErrorMessage()
ClosableReportingIterator
getErrorMessage
in interface ClosableReportingIterator<String[]>
public Exception getException()
ClosableReportingIterator
getException
in interface ClosableReportingIterator<String[]>
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.