C - The type of column used by the table.T - The type of data stored in the table.public interface Table<C extends Column<? extends T>,T> extends List<C>
| 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.
|
List<C> |
appendColumns(int count)
Appends a number of columns (with no headers) to the table.
|
List<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.
|
void |
clear()
Removes all data (including row and column headers) from the table.
|
boolean |
contains(Object column)
Gets whether the table contains the given column.
|
boolean |
containsAll(Collection<?> c)
Returns true if the table contains all of the columns of the
specified collection.
|
C |
get(int col)
Returns the column at the specified position in the table.
|
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.
|
int |
indexOf(Object column)
Returns the index of the first occurrence of the specified column in the
table, or -1 if the table does not contain the column.
|
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.
|
List<C> |
insertColumns(int col,
int count)
Inserts a block of columns (with no headers) at the given position in the
table.
|
List<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.
|
boolean |
isEmpty()
Gets whether the table is empty.
|
Iterator<C> |
iterator()
Returns an iterator over the columns in the table in proper sequence.
|
int |
lastIndexOf(Object column)
Returns the index of the last occurrence of the specified column in the
table, or -1 if the table does not contain the column.
|
ListIterator<C> |
listIterator()
Returns a list iterator over the columns in the table (in proper sequence).
|
ListIterator<C> |
listIterator(int col)
Returns a list iterator of the columns in the table (in proper sequence),
starting at the specified position in the table.
|
C |
remove(int col)
Removes the column at the specified position in the table.
|
boolean |
remove(Object column)
Removes the first occurrence of the specified column from the table, if it
is present.
|
boolean |
removeAll(Collection<?> c)
Removes from the table all of its columns that are contained in the
specified collection.
|
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.
|
List<C> |
removeColumns(int col,
int count)
Removes a block of columns starting at the given position from the table.
|
List<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.
|
boolean |
retainAll(Collection<?> c)
Retains only the columns in the table that are contained in the specified
collection.
|
C |
set(int col,
C column)
Replaces the column at the specified position in the table with the
specified column.
|
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.
|
int |
size()
Gets the number of columns in the table.
|
List<C> |
subList(int fromCol,
int toCol)
Returns a view of the portion of the table between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
Object[] |
toArray()
Returns an array containing all of the columns in the table in proper
sequence (from first to last column).
|
<A> A[] |
toArray(A[] a)
Returns an array containing all of the column in the table in proper
sequence (from first to last column); the runtime type of the returned
array is that of the specified array.
|
equals, hashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streamint getColumnCount()
void setColumnCount(int colCount)
C appendColumn()
C appendColumn(String header)
List<C> appendColumns(int count)
List<C> appendColumns(String... headers)
C insertColumn(int col)
C insertColumn(int col, String header)
List<C> insertColumns(int col, int count)
List<C> insertColumns(int col, String... headers)
C removeColumn(int col)
C removeColumn(String header)
List<C> removeColumns(int col, int count)
List<C> removeColumns(String... headers)
int getRowCount()
void setRowCount(int rowCount)
void appendRow()
void appendRow(String header)
void appendRows(int count)
void appendRows(String... headers)
void insertRow(int row)
void insertRow(int row,
String header)
void insertRows(int row,
int count)
void insertRows(int row,
String... headers)
void removeRow(int row)
void removeRow(String header)
void removeRows(int row,
int count)
void removeRows(String... headers)
void setDimensions(int colCount,
int rowCount)
String getColumnHeader(int col)
void setColumnHeader(int col,
String header)
int getColumnIndex(String header)
String getRowHeader(int row)
void setRowHeader(int row,
String header)
int getRowIndex(String header)
void set(int col,
int row,
T value)
T get(int col, int row)
int size()
boolean isEmpty()
boolean contains(Object column)
Iterator<C> iterator()
Object[] toArray()
<A> A[] toArray(A[] a)
boolean add(C column)
Updates the row count if this column has more rows than current table and scales the existing columns to have the same number of rows.
boolean remove(Object column)
boolean containsAll(Collection<?> c)
containsAll in interface Collection<C extends Column<? extends T>>containsAll in interface List<C extends Column<? extends T>>boolean addAll(Collection<? extends C> c)
Updates the row count if necessary, and scales the columns to match the row count if necessary.
boolean addAll(int col,
Collection<? extends C> c)
Updates the row count if necessary, and scales the columns to match the row count if necessary.
boolean removeAll(Collection<?> c)
boolean retainAll(Collection<?> c)
void clear()
If you want to retain the column headers, call setRowCount(int)
with a value of 0. If you want to retain the row headers, call
setColumnCount(int) with a value of 0.
C get(int col)
C set(int col, C column)
No checking is done to ensure the new column has the same number of rows as the other existing columns.
void add(int col,
C column)
Updates the row count if this column has more rows than current table and scales the existing columns to have the same number of rows.
C remove(int col)
int indexOf(Object column)
int lastIndexOf(Object column)
lastIndexOf in interface List<C extends Column<? extends T>>ListIterator<C> listIterator()
listIterator in interface List<C extends Column<? extends T>>ListIterator<C> listIterator(int col)
listIterator in interface List<C extends Column<? extends T>>Copyright © 2018 SciJava. All rights reserved.