Package org.openforis.commons.io.csv
Class CsvReader
java.lang.Object
org.openforis.commons.io.csv.CsvProcessor
org.openforis.commons.io.csv.CsvReader
- All Implemented Interfaces:
Closeable,AutoCloseable,FlatDataStream
- Author:
- G. Miceli, M. Togna, S. Ricci
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charstatic final char -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longbooleanvoidvoidsetHeadersRead(boolean headersRead) intsize()Returns the number of lines including the headersMethods inherited from class org.openforis.commons.io.csv.CsvProcessor
setDateFormat, setDateFormat, setFieldNames, setFields, setFields
-
Field Details
-
DEFAULT_SEPARATOR
public static final char DEFAULT_SEPARATOR- See Also:
-
DEFAULT_QUOTE_CHARACTER
public static final char DEFAULT_QUOTE_CHARACTER- See Also:
-
-
Constructor Details
-
CsvReader
- Throws:
FileNotFoundException
-
CsvReader
- Throws:
FileNotFoundException
-
CsvReader
- Throws:
FileNotFoundException
-
CsvReader
- Throws:
FileNotFoundException
-
CsvReader
public CsvReader(File file, String charsetName, char separator, char quoteChar) throws FileNotFoundException - Throws:
FileNotFoundException
-
CsvReader
Deprecated.CallCsvReader(File)instead. -
CsvReader
Deprecated.CallCsvReader(File, char, char)instead.
-
-
Method Details
-
readHeaders
- Throws:
IOException
-
readNextLine
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isHeadersRead
public boolean isHeadersRead() -
setHeadersRead
public void setHeadersRead(boolean headersRead) -
getLinesRead
public long getLinesRead() -
getFields
- Specified by:
getFieldsin interfaceFlatDataStream- Overrides:
getFieldsin classCsvProcessor
-
getFieldNames
- Overrides:
getFieldNamesin classCsvProcessor
-
nextRecord
- Specified by:
nextRecordin interfaceFlatDataStream- Throws:
IOException
-
getColumnNames
-
getDateFormat
- Overrides:
getDateFormatin classCsvProcessor
-
size
Returns the number of lines including the headers- Returns:
- Throws:
IOException
-
CsvReader(File)instead.