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 of
IHeaderTable. Implements all methods that can be derived from other methods. You
only need to implement IHeaderTable.columnNames() and IHeaderTable.rows(). You should also implement
columnToIndex(String) and hasColumn(String) for performance reasons. All other methods cannot are
final and cannot be overridden.- Since:
- 8.2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface IHeaderTable
IHeaderTable.ITableRowEntry<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Tcell(int row, int column) Gets the value at the given row and column.final TGets the value at the given row and column.final intReturns the number of columns in the table.columnsByIndex(int row) Gets a view of the given row as a map.columnsByName(int row) Gets a view of the given row as a map.intcolumnToIndex(String column) Converts a column name to an index.booleanfinal booleanhasColumn(int column) Checks if the table has a column at the given index.booleanChecks if the table has a column with the given name.inthashCode()final booleanhasRow(int row) Checks if the table has a row at the given index.final StringindexToColumn(int index) Converts an index to a column name.row(int index) Returns a view of the given row.final introwCount()Returns the number of rows in the table.final Iterator<IHeaderTable.ITableRowEntry<T>> Returns an iterator over the rows of the table.rows(int column) Returns a view of all rows at the given column.Returns a view of all rows at the given column.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IHeaderTable
columnNames, iterator, rowsMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
AbstractHeaderTable
public AbstractHeaderTable()
-
-
Method Details
-
cell
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
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
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
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
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.
-
equals
-
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
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.
-
hashCode
-
indexToColumn
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
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
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
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
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.
-