org.omnaest.utils.structure.table.subspecification
Interface TableCore<E>

Type Parameters:
E -
All Superinterfaces:
Serializable, TableCloneable<E>, TableCoreImmutable<E>, TableDataSource<E>
All Known Subinterfaces:
Table<E>
All Known Implementing Classes:
ArrayTable, SelectionExecutor.ArrayTableWithAccessibleTableInternal, TableAbstract, TableBasic

public interface TableCore<E>
extends TableCoreImmutable<E>

TableCore representation. Allows to create arbitrary Table structures. Offers rudimentary methods accessing the data structure.

Author:
Omnaest
See Also:
Table

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.omnaest.utils.structure.table.subspecification.TableCloneable
TableCloneable.TableCloner<E>
 
Method Summary
 Table.Column<E> addColumnCellElements(int columnIndexPosition, List<? extends E> columnCellElementList)
          Adds a Table.Column to the Table with the given Table.CellImmutable.getElement()s at the given index position of the Table.Columns.
 Table.Column<E> addColumnCellElements(List<? extends E> columnCellElementList)
          Adds a Table.Column to the Table with the given Table.CellImmutable.getElement()s at the end of the Table.Columns.
 Table.Row<E> addRowCellElements(int rowIndexPosition, List<? extends E> rowCellElementList)
          Adds a new Table.Row to the Table at the given index position.
 Table.Row<E> addRowCellElements(List<? extends E> rowCellElementList)
          Adds a new row to the table.
 Table<E> clear()
          Clears the table, so that there are no elements left.
 Table<E> convertFirstColumnToTitle()
          Converts the first column to row titles.
 Table<E> convertFirstRowToTitle()
          Takes the first row of the table converts it to text and removes it from the table.
 Table<E> ensureNumberOfColumns(int numberOfColumns)
          Ensures the number of Table.Columns to be present
 Table<E> ensureNumberOfRows(int numberOfRows)
          Ensures the number of Table.Rows to be present
 Table<E> putArray(E[][] elementArray, int rowIndexPosition, int columnIndexPosition)
          Puts an array into the table.
 Table<E> putTable(TableDataSource<E> tableCellElementSource, int rowIndexPosition, int columnIndexPosition)
          Puts a foreign table into the current table at the given index position.
 List<E> removeColumn(int columnIndexPosition)
          Removes a Table.Column at the given index position from the Table.
 List<E> removeColumn(Table.Column<E> column)
          Removes the given Table.Column from the Table
 List<E> removeRow(int rowIndexPosition)
          Removes a Table.Row at the given index position from the Table.
 List<E> removeRow(Table.Row<E> row)
          Removes the given Table.Row from the Table
 List<List<E>> removeRows(int[] rowIndexPositions)
          Removes all the given rows.
 Table<E> setCellElement(int cellIndexPosition, E element)
          Puts a new element to the table at the defined cell index position.
 Table<E> setCellElement(int rowIndexPosition, int columnIndexPosition, E element)
          Puts a new element to the table at the defined index positions.
 Table<E> setColumnCellElements(int columnIndexPosition, List<? extends E> columnCellElementList)
          Puts a column at the given column index position.
 Table<E> setColumnTitleValue(Object titleValue, int columnIndexPosition)
          Sets the title of a column for a given column index position.
 Table<E> setColumnTitleValues(List<?> titleValueList)
          Sets the Table.Stripe.Titles of the Table.Columns.
 Table<E> setColumnTitleValues(Object... titleValues)
           
 Table<E> setNumberOfColumns(int numberOfColumns)
          Sets the number of Table.Columns
 Table<E> setNumberOfRows(int numberOfRows)
          Sets the number of Table.Rows
 Table<E> setRowCellElements(int rowIndexPosition, List<? extends E> rowCellElementList)
          Puts a row at the given row index position
 Table<E> setRowTitleValue(Object titleValue, int rowIndexPosition)
          Sets the Table.Stripe.Title for a Table.Row with the given index position.
 Table<E> setRowTitleValues(List<?> titleValueList)
          Sets the Table.Stripe.Title for the Table.Rows.
 Table<E> setRowTitleValues(Object... titleValues)
           
 Table<E> setTableName(Object tableName)
          Sets the name of the whole table.
 Table<E> transpose()
          Transposes the whole table, which means to swap rows and columns.
 Table<E> truncateRows(int rowIndexPosition)
          Deletes all Table.Rows including the given Table.Row index position to the end of the Table
 
Methods inherited from interface org.omnaest.utils.structure.table.subspecification.TableCoreImmutable
cells, columns, contains, convert, equals, getCell, getCell, getCell, getCell, getCell, getCellElement, getCellElement, getCellElementList, getCellList, getColumn, getColumn, getColumnList, getColumnTitleValue, getColumnTitleValueList, getFirstColumn, getFirstRow, getLastColumn, getLastRow, getRow, getRow, getRowList, getRowTitleValue, getRowTitleValueList, getTableName, getTableSize, hasColumnTitles, hasRowTitles, hasTableName, iterator, iteratorCell, iteratorColumn, processTableCells, rows
 
Methods inherited from interface org.omnaest.utils.structure.table.subspecification.TableCloneable
clone
 

Method Detail

putTable

Table<E> putTable(TableDataSource<E> tableCellElementSource,
                  int rowIndexPosition,
                  int columnIndexPosition)
Puts a foreign table into the current table at the given index position. This means, if there are already filled cells, they will be overwritten.

Parameters:
tableCellElementSource -
rowIndexPosition -
columnIndexPosition -
Returns:
this

putArray

Table<E> putArray(E[][] elementArray,
                  int rowIndexPosition,
                  int columnIndexPosition)
Puts an array into the table. If there are already filled cells on the given position, they will be overwritten.

Parameters:
elementArray -
rowIndexPosition -
columnIndexPosition -
Returns:
this

transpose

Table<E> transpose()
Transposes the whole table, which means to swap rows and columns.

Returns:
this

setRowTitleValue

Table<E> setRowTitleValue(Object titleValue,
                          int rowIndexPosition)
Sets the Table.Stripe.Title for a Table.Row with the given index position.

Parameters:
titleValue -
rowIndexPosition -
Returns:
this
See Also:
TableCoreImmutable.getRowTitleValue(int)

setRowTitleValues

Table<E> setRowTitleValues(List<?> titleValueList)
Sets the Table.Stripe.Title for the Table.Rows. This means the visual identifiers at the left of the Table.

Parameters:
titleValueList -
Returns:
this
See Also:
setRowTitleValue(Object, int), setRowTitleValues(Object...)

setRowTitleValues

Table<E> setRowTitleValues(Object... titleValues)
Parameters:
titleValues -
Returns:
See Also:
setRowTitleValues(List)

setColumnTitleValues

Table<E> setColumnTitleValues(List<?> titleValueList)
Sets the Table.Stripe.Titles of the Table.Columns. The Table.Stripe.Titles can be used to identify a Table.Column, or together with a Table.Row a single Table.Cell.

Parameters:
titleValueList -
Returns:
See Also:
setColumnTitleValues(Object...)

setColumnTitleValues

Table<E> setColumnTitleValues(Object... titleValues)
Parameters:
titleValues -
Returns:
See Also:
setColumnTitleValues(List)

setColumnTitleValue

Table<E> setColumnTitleValue(Object titleValue,
                             int columnIndexPosition)
Sets the title of a column for a given column index position.

Parameters:
titleValue -
columnIndexPosition -
Returns:
this

setTableName

Table<E> setTableName(Object tableName)
Sets the name of the whole table.

Parameters:
tableTitle -
Returns:
this

clear

Table<E> clear()
Clears the table, so that there are no elements left.
This removes all indexes set.

Returns:

addColumnCellElements

Table.Column<E> addColumnCellElements(List<? extends E> columnCellElementList)
Adds a Table.Column to the Table with the given Table.CellImmutable.getElement()s at the end of the Table.Columns.

Parameters:
columnCellElementList -
Returns:
this

setCellElement

Table<E> setCellElement(int rowIndexPosition,
                        int columnIndexPosition,
                        E element)
Puts a new element to the table at the defined index positions.


setCellElement

Table<E> setCellElement(int cellIndexPosition,
                        E element)
Puts a new element to the table at the defined cell index position.


setRowCellElements

Table<E> setRowCellElements(int rowIndexPosition,
                            List<? extends E> rowCellElementList)
Puts a row at the given row index position

Parameters:
rowIndexPosition -
rowCellElementList -
Returns:
this

setColumnCellElements

Table<E> setColumnCellElements(int columnIndexPosition,
                               List<? extends E> columnCellElementList)
Puts a column at the given column index position.

Parameters:
columnIndexPosition -
columnCellElementList -
Returns:

addColumnCellElements

Table.Column<E> addColumnCellElements(int columnIndexPosition,
                                      List<? extends E> columnCellElementList)
Adds a Table.Column to the Table with the given Table.CellImmutable.getElement()s at the given index position of the Table.Columns. Already existing Table.Columns at this index position will be moved one index position further. If the index position is above the size of the current Table.Columns, as many Table.Columns are created as necessary to make the Table.Column available at the given index position.

Parameters:
columnIndexPosition -
columnCellElementList -
Returns:

addRowCellElements

Table.Row<E> addRowCellElements(List<? extends E> rowCellElementList)
Adds a new row to the table.
If the row has more elements, than the table has columns, the table will be expanded with new empty columns to match the row element number.

Parameters:
rowCellElementList -
Returns:
this

addRowCellElements

Table.Row<E> addRowCellElements(int rowIndexPosition,
                                List<? extends E> rowCellElementList)
Adds a new Table.Row to the Table at the given index position. If there is already a Table.Row or following Table.Rows for the given index position, they are moved one index position forward. If the index position is out of bounds as many Table.Rows are created to make it possible to access the Table.Row at the given index position.

Parameters:
rowIndexPosition -
rowCellElementList -
Returns:
this

removeRow

List<E> removeRow(int rowIndexPosition)
Removes a Table.Row at the given index position from the Table.

Parameters:
rowIndexPosition -
Returns:
List of Table.CellImmutable.getElement() instances of the removed Table.Row

removeColumn

List<E> removeColumn(int columnIndexPosition)
Removes a Table.Column at the given index position from the Table.

Parameters:
columnIndexPosition -
Returns:
List of Table.CellImmutable.getElement() instances of the removed Table.Column

removeRows

List<List<E>> removeRows(int[] rowIndexPositions)
Removes all the given rows.

Parameters:
rowIndexPositions -
Returns:

convertFirstRowToTitle

Table<E> convertFirstRowToTitle()
Takes the first row of the table converts it to text and removes it from the table.

Returns:
this

convertFirstColumnToTitle

Table<E> convertFirstColumnToTitle()
Converts the first column to row titles. The first column will be removed from the table data.

Returns:
this

setNumberOfColumns

Table<E> setNumberOfColumns(int numberOfColumns)
Sets the number of Table.Columns

Parameters:
numberOfColumns -
Returns:
this

ensureNumberOfColumns

Table<E> ensureNumberOfColumns(int numberOfColumns)
Ensures the number of Table.Columns to be present

Parameters:
numberOfColumns -
Returns:
this

setNumberOfRows

Table<E> setNumberOfRows(int numberOfRows)
Sets the number of Table.Rows

Parameters:
numberOfRows -
Returns:
this

ensureNumberOfRows

Table<E> ensureNumberOfRows(int numberOfRows)
Ensures the number of Table.Rows to be present

Parameters:
numberOfRows -
Returns:
this

truncateRows

Table<E> truncateRows(int rowIndexPosition)
Deletes all Table.Rows including the given Table.Row index position to the end of the Table

Parameters:
rowIndexPosition -
Returns:

removeRow

List<E> removeRow(Table.Row<E> row)
Removes the given Table.Row from the Table

Parameters:
row -
Returns:

removeColumn

List<E> removeColumn(Table.Column<E> column)
Removes the given Table.Column from the Table

Parameters:
column -
Returns:


Copyright © 2011. All Rights Reserved.