T - The type of data stored in the table.public abstract class AbstractTable<C extends Column<? extends T>,T> extends SizableArrayList<C> implements Table<C,T>
Table implementations.modCount| Constructor and Description |
|---|
AbstractTable()
Creates an empty table.
|
AbstractTable(int colCount,
int rowCount)
Creates a table with the given column and row dimensions.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(C column)
Appends the specified column to the end of the table.
|
void |
add(int col,
C column)
Inserts the specified column at the specified position in the table.
|
boolean |
addAll(Collection<? extends C> c)
Appends all of the columns in the specified collection to the end of the
table, in the order that they are returned by the specified collection's
iterator.
|
boolean |
addAll(int col,
Collection<? extends C> c)
Inserts all of the columns in the specified collection into this list at
the specified position.
|
C |
appendColumn()
Appends a column (with no header) to the table.
|
C |
appendColumn(String header)
Appends a column with the given header to the table.
|
ArrayList<C> |
appendColumns(int count)
Appends a number of columns (with no headers) to the table.
|
ArrayList<C> |
appendColumns(String... headers)
Appends a block of columns with the given headers to the table.
|
void |
appendRow()
Appends a row (with no header) to the table.
|
void |
appendRow(String header)
Appends a row with the given header to the table.
|
void |
appendRows(int count)
Appends a block of rows (with no headers) to the table.
|
void |
appendRows(String... headers)
Appends a block of rows with the given headers to the table.
|
protected abstract C |
createColumn(String header) |
T |
get(int col,
int row)
Gets the table value at the given column and row.
|
C |
get(String colHeader)
Returns the first column with the given header in the table.
|
T |
get(String colHeader,
int row)
Gets the table value at the given column and row.
|
int |
getColumnCount()
Gets the number of columns in the table.
|
String |
getColumnHeader(int col)
Gets the column header at the given column.
|
int |
getColumnIndex(String header)
Gets the column index of the column with the given header.
|
int |
getRowCount()
Gets the number of rows in the table.
|
String |
getRowHeader(int row)
Gets the row header at the given row.
|
int |
getRowIndex(String header)
Gets the row index of the row with the given header.
|
C |
insertColumn(int col)
Inserts a column (with no header) at the given position in the table.
|
C |
insertColumn(int col,
String header)
Inserts a column with the specified header at the given position in the
table.
|
ArrayList<C> |
insertColumns(int col,
int count)
Inserts a block of columns (with no headers) at the given position in the
table.
|
ArrayList<C> |
insertColumns(int col,
String... headers)
Inserts a block of columns with the specified headers at the given position
in the table.
|
void |
insertRow(int row)
Inserts a row (with no header) at the given position in the table.
|
void |
insertRow(int row,
String header)
Inserts a row with the specified header at the given position in the table.
|
void |
insertRows(int row,
int count)
Inserts a block of rows (with no headers) at the given position in the
table.
|
void |
insertRows(int row,
String... headers)
Inserts a block of rows with the specified headers at the given position in
the table.
|
C |
removeColumn(int col)
Removes the column at the given position from the table.
|
C |
removeColumn(String header)
Removes the first column with the given header from the table.
|
ArrayList<C> |
removeColumns(int col,
int count)
Removes a block of columns starting at the given position from the table.
|
ArrayList<C> |
removeColumns(String... headers)
Removes the first columns with the given headers from the table.
|
void |
removeRow(int row)
Removes the row at the given position from the table.
|
void |
removeRow(String header)
Removes the first row with the given header from the table.
|
void |
removeRows(int row,
int count)
Removes a block of rows starting at the given position from the table.
|
void |
removeRows(String... headers)
Removes the first rows with the given headers from the table.
|
void |
set(int col,
int row,
T value)
Sets the table value at the given column and row.
|
void |
set(String colHeader,
int row,
T value)
Sets the table value at the given column and row.
|
void |
setColumnCount(int colCount)
Sets the number of columns in the table.
|
void |
setColumnHeader(int col,
String header)
Sets the column header at the given column.
|
void |
setDimensions(int colCount,
int rowCount)
Sets the number of columns and rows in the table.
|
void |
setRowCount(int rowCount)
Sets the number of rows in the table.
|
void |
setRowHeader(int row,
String header)
Sets the row header at the given row.
|
ensureCapacity, setSizeclear, clone, contains, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitclear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArrayequals, hashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streampublic AbstractTable()
public AbstractTable(int colCount,
int rowCount)
public int getColumnCount()
Tablepublic void setColumnCount(int colCount)
Tablepublic C get(String colHeader)
Tablepublic C appendColumn()
Tablepublic C appendColumn(String header)
Tablepublic ArrayList<C> appendColumns(int count)
Tablepublic ArrayList<C> appendColumns(String... headers)
Tablepublic C insertColumn(int col)
Tablepublic C insertColumn(int col, String header)
Tablepublic ArrayList<C> insertColumns(int col, int count)
Tablepublic ArrayList<C> insertColumns(int col, String... headers)
Tablepublic C removeColumn(int col)
Tablepublic C removeColumn(String header)
Tablepublic ArrayList<C> removeColumns(int col, int count)
Tablepublic ArrayList<C> removeColumns(String... headers)
Tablepublic int getRowCount()
Tablepublic void setRowCount(int rowCount)
Tablepublic void appendRow()
Tablepublic void appendRow(String header)
Tablepublic void appendRows(int count)
Tablepublic void appendRows(String... headers)
Tablepublic void insertRow(int row)
Tablepublic void insertRow(int row,
String header)
Tablepublic void insertRows(int row,
int count)
Tablepublic void insertRows(int row,
String... headers)
Tablepublic void removeRow(int row)
Tablepublic void removeRow(String header)
Tablepublic void removeRows(int row,
int count)
Tablepublic void removeRows(String... headers)
Tablepublic void setDimensions(int colCount,
int rowCount)
Tablepublic String getColumnHeader(int col)
Tablepublic void setColumnHeader(int col,
String header)
Tablepublic int getColumnIndex(String header)
Tablepublic String getRowHeader(int row)
Tablepublic void setRowHeader(int row,
String header)
Tablepublic int getRowIndex(String header)
Tablepublic void set(int col,
int row,
T value)
Tablepublic void set(String colHeader, int row, T value)
Tablepublic T get(int col, int row)
Tablepublic T get(String colHeader, int row)
Tablepublic boolean add(C column)
TableUpdates the row count if this column has more rows than current table and scales the existing columns to have the same number of rows.
public void add(int col,
C column)
TableUpdates the row count if this column has more rows than current table and scales the existing columns to have the same number of rows.
public boolean addAll(Collection<? extends C> c)
TableUpdates the row count if necessary, and scales the columns to match the row count if necessary.
addAll in interface Collection<C extends Column<? extends T>>addAll in interface List<C extends Column<? extends T>>addAll in interface Table<C extends Column<? extends T>,T>addAll in class ArrayList<C extends Column<? extends T>>public boolean addAll(int col,
Collection<? extends C> c)
TableUpdates the row count if necessary, and scales the columns to match the row count if necessary.
Copyright © 2018 SciJava. All rights reserved.