Top Description Methods
com.univocity.parsers.common.processor.core

pack-priv Interface ColumnReader<T>

Known Direct Subinterfaces
com.univocity.parsers.common.processor.core.BatchedColumnReader
Known Direct Implementers
com.univocity.parsers.common.processor.core.AbstractColumnProcessor, com.univocity.parsers.common.processor.core.AbstractObjectColumnProcessor
Type Parameters
<T>
the type of the data stored by the columns.
Imports
com.univocity.parsers.common.*, java.util.*

A common interface for Processors that collect the values parsed from each column in a row. Namely: AbstractColumnProcessor, AbstractObjectColumnProcessor, AbstractBatchedColumnProcessor and AbstractBatchedObjectColumnProcessor.
Author
Univocity Software Pty Ltd - [email protected]
See Also
AbstractColumnProcessor, AbstractObjectColumnProcessor, AbstractBatchedColumnProcessor, AbstractBatchedObjectColumnProcessor, Processor

Method Summary

Modifier and TypeMethod and Description
public List<T>

Returns:

a list with all data stored in the given column
getColumn
(String
the name of the column in the input.
columnName
)

Returns the values of a given column.

public List<T>

Returns:

a list with all data stored in the given column
getColumn
(int
the position of the column in the input (0-based).
columnIndex
)

Returns the values of a given column.

public List<List<T>>

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.
getColumnValuesAsList
()

Returns the values processed for each column

public Map<Integer, List<T>>

Returns:

a map of column indexes and their respective list of values.
getColumnValuesAsMapOfIndexes
()

Returns a map of column indexes and their respective list of values parsed from the input.

public Map<String, List<T>>

Returns:

a map of column names and their respective list of values.
getColumnValuesAsMapOfNames
()

Returns a map of column names and their respective list of values parsed from the input.

public String[]

Returns:

the headers of all column parsed.
getHeaders
()

Returns the column headers.

public void
putColumnValuesInMapOfIndexes(Map<Integer, List<T>>
the map to hold the values of each column
map
)

Fills a given map associating each column index to its list of values

public void
putColumnValuesInMapOfNames(Map<String, List<T>>
the map to hold the values of each column
map
)

Fills a given map associating each column name to its list o values

Method Detail

getColumnback to summary
public List<T> getColumn(String columnName)

Returns the values of a given column.

Parameters
columnName:String

the name of the column in the input.

Returns:List<T>

a list with all data stored in the given column

getColumnback to summary
public List<T> getColumn(int columnIndex)

Returns the values of a given column.

Parameters
columnIndex:int

the position of the column in the input (0-based).

Returns:List<T>

a list with all data stored in the given column

getColumnValuesAsListback to summary
public List<List<T>> getColumnValuesAsList()

Returns the values processed for each column

Returns:List<List<T>>

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.

getColumnValuesAsMapOfIndexesback to summary
public Map<Integer, List<T>> getColumnValuesAsMapOfIndexes()

Returns a map of column indexes and their respective list of values parsed from the input.

Returns:Map<Integer, List<T>>

a map of column indexes and their respective list of values.

getColumnValuesAsMapOfNamesback to summary
public Map<String, List<T>> getColumnValuesAsMapOfNames()

Returns a map of column names and their respective list of values parsed from the input.

Returns:Map<String, List<T>>

a map of column names and their respective list of values.

getHeadersback to summary
public String[] getHeaders()

Returns the column headers. This can be either the headers defined in CommonSettings#getHeaders() or the headers parsed in the input when CommonSettings#getHeaders() equals to true

Returns:String[]

the headers of all column parsed.

putColumnValuesInMapOfIndexesback to summary
public void putColumnValuesInMapOfIndexes(Map<Integer, List<T>> map)

Fills a given map associating each column index to its list of values

Parameters
map:Map<Integer, List<T>>

the map to hold the values of each column

putColumnValuesInMapOfNamesback to summary
public void putColumnValuesInMapOfNames(Map<String, List<T>> map)

Fills a given map associating each column name to its list o values

Parameters
map:Map<String, List<T>>

the map to hold the values of each column

Exceptions
IllegalArgumentException:
if a column does not have a name associated to it. In this case, use putColumnValuesInMapOfIndexes(Map) instead.