Interface ColumnReader<T>
-
- Type Parameters:
T
- the type of the data stored by the columns.
- All Known Subinterfaces:
BatchedColumnReader<T>
- All Known Implementing Classes:
AbstractBatchedColumnProcessor
,AbstractBatchedObjectColumnProcessor
,AbstractColumnProcessor
,AbstractObjectColumnProcessor
,BatchedColumnProcessor
,BatchedObjectColumnProcessor
,ColumnProcessor
,ObjectColumnProcessor
interface ColumnReader<T>
A common interface forProcessor
s that collect the values parsed from each column in a row. Namely:AbstractColumnProcessor
,AbstractObjectColumnProcessor
,AbstractBatchedColumnProcessor
andAbstractBatchedObjectColumnProcessor
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<T>
getColumn(int columnIndex)
Returns the values of a given column.java.util.List<T>
getColumn(java.lang.String columnName)
Returns the values of a given column.java.util.List<java.util.List<T>>
getColumnValuesAsList()
Returns the values processed for each columnjava.util.Map<java.lang.Integer,java.util.List<T>>
getColumnValuesAsMapOfIndexes()
Returns a map of column indexes and their respective list of values parsed from the input.java.util.Map<java.lang.String,java.util.List<T>>
getColumnValuesAsMapOfNames()
Returns a map of column names and their respective list of values parsed from the input.java.lang.String[]
getHeaders()
Returns the column headers.void
putColumnValuesInMapOfIndexes(java.util.Map<java.lang.Integer,java.util.List<T>> map)
Fills a given map associating each column index to its list of valuesvoid
putColumnValuesInMapOfNames(java.util.Map<java.lang.String,java.util.List<T>> map)
Fills a given map associating each column name to its list o values
-
-
-
Method Detail
-
getHeaders
java.lang.String[] getHeaders()
Returns the column headers. This can be either the headers defined inCommonSettings.getHeaders()
or the headers parsed in the input whenCommonSettings.getHeaders()
equals totrue
- Returns:
- the headers of all column parsed.
-
getColumnValuesAsList
java.util.List<java.util.List<T>> getColumnValuesAsList()
Returns the values processed for each column- Returns:
- a list of lists. The stored lists correspond to the position of the column processed from the input; Each list contains the corresponding values parsed for a column, across multiple rows.
-
putColumnValuesInMapOfNames
void putColumnValuesInMapOfNames(java.util.Map<java.lang.String,java.util.List<T>> map)
Fills a given map associating each column name to its list o values- Parameters:
map
- the map to hold the values of each column- Throws:
java.lang.IllegalArgumentException
- if a column does not have a name associated to it. In this case, useputColumnValuesInMapOfIndexes(Map)
instead.
-
putColumnValuesInMapOfIndexes
void putColumnValuesInMapOfIndexes(java.util.Map<java.lang.Integer,java.util.List<T>> map)
Fills a given map associating each column index to its list of values- Parameters:
map
- the map to hold the values of each column
-
getColumnValuesAsMapOfNames
java.util.Map<java.lang.String,java.util.List<T>> getColumnValuesAsMapOfNames()
Returns a map of column names and their respective list of values parsed from the input.- Returns:
- a map of column names and their respective list of values.
-
getColumnValuesAsMapOfIndexes
java.util.Map<java.lang.Integer,java.util.List<T>> getColumnValuesAsMapOfIndexes()
Returns a map of column indexes and their respective list of values parsed from the input.- Returns:
- a map of column indexes and their respective list of values.
-
getColumn
java.util.List<T> getColumn(java.lang.String columnName)
Returns the values of a given column.- Parameters:
columnName
- the name of the column in the input.- Returns:
- a list with all data stored in the given column
-
getColumn
java.util.List<T> getColumn(int columnIndex)
Returns the values of a given column.- Parameters:
columnIndex
- the position of the column in the input (0-based).- Returns:
- a list with all data stored in the given column
-
-