public interface CellField extends Iterable<Row>
Modifier and Type | Method and Description |
---|---|
<T> Column<T> |
addColumn(Class<T> type,
String name)
Add a column.
|
<T> Column<T> |
addColumn(Class<T> type,
String name,
List<T> data)
Adds a column that uses the provided list to store the elements.
|
Column<Object> |
addColumn(String name)
Add an Object column.
|
Column<Double> |
addDoubleColumn(String name)
Add a Double column.
|
Column<Integer> |
addIntegerColumn(String name)
Add an integer column.
|
Row |
addRow()
Add new empty row.
|
RowBuilder |
addRowBuilder()
Row builder.
|
Column<String> |
addStringColumn(String name)
Add a String column.
|
<T> T |
get(Row row,
Column<T> col)
Get a cell.
|
List<Column<?>> |
getColumns()
Get all columns.
|
Row |
getRow(int rowIndex)
Get a row.
|
int |
getRowCount()
Rows.
|
int |
indexOf(Row row)
Look up row index.
|
<T> void |
set(Row row,
Column<T> col,
T data)
Set a cell.
|
forEach, iterator, spliterator
int getRowCount()
Row getRow(int rowIndex)
rowIndex
- Row indexint indexOf(Row row)
row
- Row to look up<T> Column<T> addColumn(Class<T> type, String name)
T
- Column typetype
- Column typename
- Column name<T> Column<T> addColumn(Class<T> type, String name, List<T> data)
If the list is not empty the new instance is initialized with the given elements.
T
- Column typetype
- Column typename
- Column namedata
- Column dataColumn<String> addStringColumn(String name)
name
- Column nameColumn<Integer> addIntegerColumn(String name)
name
- Column nameColumn<Double> addDoubleColumn(String name)
name
- Column nameColumn<Object> addColumn(String name)
name
- Column nameRowBuilder addRowBuilder()
Row addRow()
<T> void set(Row row, Column<T> col, T data)
T
- Column typerow
- Rowcol
- Columndata
- Data to set