Package adams.data.io.input
Class FastCsvSpreadSheetReader.ChunkReader
- java.lang.Object
-
- adams.data.io.input.FastCsvSpreadSheetReader.ChunkReader
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- FastCsvSpreadSheetReader
public static class FastCsvSpreadSheetReader.ChunkReader extends Object implements Serializable
Reads CSV files chunk by chunk.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_ChunkSize
the chunk size to use.protected String
m_CustomColumnHeaders
the comma-separated list of column header names.protected int
m_FirstRow
the first row to retrieve (1-based).protected SpreadSheet
m_Header
the header.protected BaseRegExp
m_MissingValue
the missing value.protected boolean
m_NoHeader
whether the file has a header or not.protected boolean[]
m_NumericCols
the numeric columns.protected Range
m_NumericColumns
the columns to treat as numeric.protected int
m_NumRows
the number of rows to retrieve (less than 1 = unlimited).protected FastCsvSpreadSheetReader
m_Owner
the owning reader.protected String
m_QuoteCharacter
the quote character.protected BufferedReader
m_Reader
the reader in use.protected int
m_RowCount
the rows read so far.protected String
m_Separator
the column separator.protected boolean
m_Trim
whether to trim the cell content.
-
Constructor Summary
Constructors Constructor Description ChunkReader(FastCsvSpreadSheetReader owner)
Initializes the low-level reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
close()
Closes the reader.boolean
hasNext()
Returns whether there is more data to be read.SpreadSheet
next()
Reads the next chunk.SpreadSheet
read(Reader r)
Reads the spreadsheet content from the specified reader.
-
-
-
Field Detail
-
m_Owner
protected FastCsvSpreadSheetReader m_Owner
the owning reader.
-
m_Reader
protected BufferedReader m_Reader
the reader in use.
-
m_Header
protected SpreadSheet m_Header
the header.
-
m_MissingValue
protected BaseRegExp m_MissingValue
the missing value.
-
m_QuoteCharacter
protected String m_QuoteCharacter
the quote character.
-
m_Separator
protected String m_Separator
the column separator.
-
m_NumericColumns
protected Range m_NumericColumns
the columns to treat as numeric.
-
m_NumericCols
protected boolean[] m_NumericCols
the numeric columns.
-
m_Trim
protected boolean m_Trim
whether to trim the cell content.
-
m_NoHeader
protected boolean m_NoHeader
whether the file has a header or not.
-
m_CustomColumnHeaders
protected String m_CustomColumnHeaders
the comma-separated list of column header names.
-
m_FirstRow
protected int m_FirstRow
the first row to retrieve (1-based).
-
m_NumRows
protected int m_NumRows
the number of rows to retrieve (less than 1 = unlimited).
-
m_ChunkSize
protected int m_ChunkSize
the chunk size to use.
-
m_RowCount
protected int m_RowCount
the rows read so far.
-
-
Constructor Detail
-
ChunkReader
public ChunkReader(FastCsvSpreadSheetReader owner)
Initializes the low-level reader.- Parameters:
owner
- the owning reader
-
-
Method Detail
-
close
protected void close()
Closes the reader.
-
hasNext
public boolean hasNext()
Returns whether there is more data to be read.- Returns:
- true if more data available
-
next
public SpreadSheet next()
Reads the next chunk.- Returns:
- the next chunk
-
read
public SpreadSheet read(Reader r)
Reads the spreadsheet content from the specified reader.- Parameters:
r
- the reader to read from- Returns:
- the spreadsheet or null in case of an error
-
-