Package org.openforis.commons.io.csv
Class CsvReaderDelegate
- java.lang.Object
-
- org.openforis.commons.io.csv.CsvProcessor
-
- org.openforis.commons.io.csv.CsvReaderDelegate
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public abstract class CsvReaderDelegate extends CsvProcessor implements Closeable
- Author:
- D. Wiell, S. Ricci
-
-
Field Summary
Fields Modifier and Type Field Description protected CsvReadercsvReaderprotected booleanheadersReadprotected longlinesRead
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<String>getFieldNames()List<Field>getFields()longgetLinesRead()booleanisHeadersRead()protected abstract String[]line(long lineIdx)FlatRecordnextRecord()voidreadHeaders()abstract String[]readHeadersInternal()CsvLinereadNextLine()voidsetHeadersRead(boolean headersRead)abstract intsize()Returns the number of lines including the headers-
Methods inherited from class org.openforis.commons.io.csv.CsvProcessor
getDateFormat, setDateFormat, setDateFormat, setFieldNames, setFields, setFields
-
-
-
-
Field Detail
-
headersRead
protected boolean headersRead
-
linesRead
protected long linesRead
-
csvReader
protected CsvReader csvReader
-
-
Method Detail
-
size
public abstract int size() throws IOExceptionReturns the number of lines including the headers- Returns:
- Throws:
IOException
-
readHeadersInternal
public abstract String[] readHeadersInternal() throws IOException
- Throws:
IOException
-
line
protected abstract String[] line(long lineIdx) throws IOException
- Throws:
IOException
-
readNextLine
public CsvLine readNextLine() throws IOException
- Throws:
IOException
-
readHeaders
public void readHeaders() throws IOException- Throws:
IOException
-
isHeadersRead
public final boolean isHeadersRead()
-
getLinesRead
public final long getLinesRead()
-
getFields
public final List<Field> getFields()
- Overrides:
getFieldsin classCsvProcessor
-
getFieldNames
public final List<String> getFieldNames()
- Overrides:
getFieldNamesin classCsvProcessor
-
nextRecord
public final FlatRecord nextRecord() throws IOException
- Throws:
IOException
-
setHeadersRead
public void setHeadersRead(boolean headersRead)
-
-