T
- public abstract class MutableTable<T> extends SimbrainDataTable<T>
rowData
Constructor and Description |
---|
MutableTable() |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(T value)
Add a new column at the far right of the table.
|
void |
addColumns(int colsToAdd)
Adds a specified number of columns to the right of the table.
|
void |
addColumns(int colsToAdd,
T value)
Adds a specified number of columns to the right of the table.
|
void |
addRow(T value)
Add a new row.
|
void |
addRows(int rowsToAdd)
Add a specified number of rows to the bottom of the table.
|
void |
addRows(int rowsToAdd,
T value)
Add a specified number of rows to the bottom of the table.
|
protected void |
checkData(boolean allowRowChanges,
boolean allowColumnChanges,
java.lang.Object[][] values)
Check the integrity of the data.
|
protected java.util.List<T> |
createNewRow(T value)
Create a new row for the table, with a specified value.
|
protected java.util.List<T> |
createNewRow(T value,
int cols)
Create a new row for the table, with a specified value.
|
void |
insertColumn(int at)
Insert a new column at the specified position, using the default data.
|
void |
insertColumn(int at,
T value)
Insert a new column at the specified position.
|
void |
insertRow(int at)
Insert a new row at the specified position, using the default data.
|
void |
insertRow(int at,
T value)
Insert a new row at the specified position.
|
void |
modifyRowsColumns(int newNumRows,
int newNumCols,
T value)
Adds or removes rows (from the bottom) and columns (from the left).
|
void |
removeColumn(int columnToRemoveIndex)
Remove column at specified index.
|
void |
removeColumn(int columnToRemoveIndex,
boolean fireEvent)
Remove column with choice whether to fire an event or not.
|
void |
removeRow(int rowToRemoveIndex)
Remove a specified row.
|
void |
removeRow(int rowToRemoveIndex,
boolean fireEvent)
Remove row with choice whether to fire an event or not.
|
void |
reset(int rows,
int cols)
Reset the table structure.
|
void |
reset(int rows,
int cols,
T val)
Adds rows or columns.
|
addTableModelListener, asFlatList, asStringArray, fill, getColumnClass, getColumnCount, getColumnName, getDataType, getDefaultValue, getLogicalColumnCount, getLogicalValueAt, getRowCount, getValueAt, getXStream, isCellEditable, setColumnHeadings, setDisplayColumnHeadings, setLogicalValue, setValue, setValue, setValueAt, shuffle
public void addRow(T value)
value
- value for cells of new rowpublic void addRows(int rowsToAdd, T value)
rowsToAdd
- number of rows to addvalue
- value for cells of new rowspublic void addRows(int rowsToAdd)
rowsToAdd
- number of rows to addpublic void insertRow(int at, T value)
at
- row index for where to put the new rowvalue
- value for new row cellspublic void insertRow(int at)
at
- row index for where to put the new rowprotected java.util.List<T> createNewRow(T value)
value
- value for columns of new rowprotected java.util.List<T> createNewRow(T value, int cols)
value
- value for columns of new rowcols
- number of "logical" columns in a row for this table (i.e.
actual number of columns in the data itself, without
accounting for fist header row).public void removeRow(int rowToRemoveIndex, boolean fireEvent)
rowToRemoveIndex
- index of row to removefireEvent
- whether to fire an event or notpublic void removeRow(int rowToRemoveIndex)
rowToRemoveIndex
- index of row to remove.public void addColumn(T value)
value
- value to addpublic void addColumns(int colsToAdd, T value)
colsToAdd
- number of columns to add.value
- value for cells of new columnspublic void addColumns(int colsToAdd)
colsToAdd
- number of columns to add.public void insertColumn(int at, T value)
at
- column index where column should be addedvalue
- value for cells of new columnpublic void insertColumn(int at)
at
- column index for where to put the new rowpublic void removeColumn(int columnToRemoveIndex, boolean fireEvent)
columnToRemoveIndex
- index of row to removefireEvent
- whether to fire an event or notpublic void removeColumn(int columnToRemoveIndex)
columnToRemoveIndex
- index of column to removepublic void modifyRowsColumns(int newNumRows, int newNumCols, T value)
newNumRows
- logical number of rows in table.newNumCols
- logical number of columns in table.value
- to be used for any new columns or rows added to the table.public void reset(int rows, int cols)
rows
- number of rowscols
- number of columnspublic void reset(int rows, int cols, T val)
rows
- number of rows to add.cols
- number of columns to add.val
- value to be added to the table.protected void checkData(boolean allowRowChanges, boolean allowColumnChanges, java.lang.Object[][] values) throws TableDataException
allowRowChanges
- whether rows should be editableallowColumnChanges
- whether columns should be editablevalues
- the value to checkTableDataException
- exception if data are invalid