Package de.xima.fc.common.data.table
Class AbstractHeaderTable<T>
- java.lang.Object
 - 
- de.xima.fc.common.data.table.AbstractHeaderTable<T>
 
 
- 
- Type Parameters:
 T- The type of the cell values.
- All Implemented Interfaces:
 IHeaderTable<T>,Serializable,Iterable<IHeaderTable.ITableRowEntry<T>>
- Direct Known Subclasses:
 ImmutableListHeaderTable
public abstract class AbstractHeaderTable<T> extends Object implements IHeaderTable<T>, Serializable
Abstract implementation ofIHeaderTable. Implements all methods that can be derived from other methods. You only need to implementIHeaderTable.columnNames()andIHeaderTable.rows(). You should also implementcolumnToIndex(String)andhasColumn(String)for performance reasons. All other methods cannot are final and cannot be overridden.- Since:
 - 8.2.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface de.xima.fc.common.data.table.IHeaderTable
IHeaderTable.ITableRowEntry<T> 
 - 
 
- 
Constructor Summary
Constructors Constructor Description AbstractHeaderTable() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcell(int row, int column)Gets the value at the given row and column.Tcell(int row, String column)Gets the value at the given row and column.intcolumnCount()Returns the number of columns in the table.Map<Integer,T>columnsByIndex(int row)Gets a view of the given row as a map.Map<String,T>columnsByName(int row)Gets a view of the given row as a map.intcolumnToIndex(String column)Converts a column name to an index.booleanequals(Object obj)booleanhasColumn(int column)Checks if the table has a column at the given index.booleanhasColumn(String column)Checks if the table has a column with the given name.inthashCode()booleanhasRow(int row)Checks if the table has a row at the given index.StringindexToColumn(int index)Converts an index to a column name.List<T>row(int index)Returns a view of the given row.introwCount()Returns the number of rows in the table.Iterator<IHeaderTable.ITableRowEntry<T>>rowIterator()Returns an iterator over the rows of the table.List<T>rows(int column)Returns a view of all rows at the given column.List<T>rows(String column)Returns a view of all rows at the given column.- 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface de.xima.fc.common.data.table.IHeaderTable
columnNames, iterator, rows 
- 
Methods inherited from interface java.lang.Iterable
forEach, spliterator 
 - 
 
 - 
 
- 
- 
Method Detail
- 
cell
public final T cell(int row, String column)
Description copied from interface:IHeaderTableGets the value at the given row and column.- Specified by:
 cellin interfaceIHeaderTable<T>- Parameters:
 row- The row index.column- The column name.- Returns:
 - The value at the given row and column.
 
 
- 
cell
public final T cell(int row, int column)
Description copied from interface:IHeaderTableGets the value at the given row and column.- Specified by:
 cellin interfaceIHeaderTable<T>- Parameters:
 row- The row index.column- The column index.- Returns:
 - The value at the given row and column.
 
 
- 
columnCount
public final int columnCount()
Description copied from interface:IHeaderTableReturns the number of columns in the table.- Specified by:
 columnCountin interfaceIHeaderTable<T>- Returns:
 - The number of columns.
 
 
- 
columnToIndex
public int columnToIndex(String column)
Description copied from interface:IHeaderTableConverts a column name to an index.- Specified by:
 columnToIndexin interfaceIHeaderTable<T>- Parameters:
 column- The column name.- Returns:
 - The index of the column.
 
 
- 
columnsByIndex
public final Map<Integer,T> columnsByIndex(int row)
Description copied from interface:IHeaderTableGets a view of the given row as a map. The keys are the column indices.- Specified by:
 columnsByIndexin interfaceIHeaderTable<T>- Parameters:
 row- Index of a row.- Returns:
 - A view of the given row as a map.
 
 
- 
columnsByName
public final Map<String,T> columnsByName(int row)
Description copied from interface:IHeaderTableGets a view of the given row as a map. The keys are the column names.- Specified by:
 columnsByNamein interfaceIHeaderTable<T>- Parameters:
 row- Index of a row.- Returns:
 - A view of the given row as a map.
 
 
- 
hasColumn
public final boolean hasColumn(int column)
Description copied from interface:IHeaderTableChecks if the table has a column at the given index.- Specified by:
 hasColumnin interfaceIHeaderTable<T>- Parameters:
 column- The name of the column.- Returns:
 trueif the table has a column at the given index,falseotherwise.
 
- 
hasColumn
public boolean hasColumn(String column)
Description copied from interface:IHeaderTableChecks if the table has a column with the given name.- Specified by:
 hasColumnin interfaceIHeaderTable<T>- Parameters:
 column- The name of the column.- Returns:
 trueif the table has a column with the given name,falseotherwise.
 
- 
hasRow
public final boolean hasRow(int row)
Description copied from interface:IHeaderTableChecks if the table has a row at the given index.- Specified by:
 hasRowin interfaceIHeaderTable<T>- Parameters:
 row- The index of the row.- Returns:
 trueif the table has a row at the given index,falseotherwise.
 
- 
indexToColumn
public final String indexToColumn(int index)
Description copied from interface:IHeaderTableConverts an index to a column name.- Specified by:
 indexToColumnin interfaceIHeaderTable<T>- Parameters:
 index- The index of the column.- Returns:
 - The column name.
 
 
- 
row
public final List<T> row(int index)
Description copied from interface:IHeaderTableReturns a view of the given row. The list will have the same number of elements as there are columns in the table.- Specified by:
 rowin interfaceIHeaderTable<T>- Parameters:
 index- The index of the row.- Returns:
 - A view of the given row.
 
 
- 
rowCount
public final int rowCount()
Description copied from interface:IHeaderTableReturns the number of rows in the table.- Specified by:
 rowCountin interfaceIHeaderTable<T>- Returns:
 - The number of rows.
 
 
- 
rowIterator
public final Iterator<IHeaderTable.ITableRowEntry<T>> rowIterator()
Description copied from interface:IHeaderTableReturns an iterator over the rows of the table.- Specified by:
 rowIteratorin interfaceIHeaderTable<T>- Returns:
 - An iterator over the rows of the table.
 
 
- 
rows
public final List<T> rows(String column)
Description copied from interface:IHeaderTableReturns a view of all rows at the given column. The list will have the same number of elements as there are rows.- Specified by:
 rowsin interfaceIHeaderTable<T>- Parameters:
 column- The name of the column.- Returns:
 - A view of all rows at the given column.
 
 
- 
rows
public final List<T> rows(int column)
Description copied from interface:IHeaderTableReturns a view of all rows at the given column. The list will have the same number of elements as there are rows.- Specified by:
 rowsin interfaceIHeaderTable<T>- Parameters:
 column- The index of the column.- Returns:
 - A view of all rows at the given column.
 
 
 - 
 
 -