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 |
---|---|
default 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.
|
default 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.
|
default boolean |
addAll(int col,
Collection<? extends C> c)
Inserts all of the columns in the specified collection into this list at
the specified position.
|
default C |
appendColumn()
Appends a column (with no header) to the table.
|
default C |
appendColumn(String colHeader)
Appends a column with the given header to the table.
|
default List<C> |
appendColumns(int count)
Appends a number of columns (with no headers) to the table.
|
default List<C> |
appendColumns(String... colHeaders)
Appends a block of columns with the given headers to the table.
|
default void |
appendRow()
Appends a row (with no header) to the table.
|
default void |
appendRow(String header)
Appends a row with the given header to the table.
|
default void |
appendRows(int count)
Appends a block of rows (with no headers) to the table.
|
default 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.
|
default boolean |
contains(Object column)
Gets whether the table contains the given column.
|
default 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.
|
default T |
get(int col,
int row)
Gets the table value at the given column and row.
|
default C |
get(String colHeader)
Returns the first column with the given header in the table.
|
default T |
get(String colHeader,
int row)
Gets the table value at the given column and row.
|
default int |
getColumnCount()
Gets the number of columns in the table.
|
default String |
getColumnHeader(int col)
Gets the column header at the given column.
|
default int |
getColumnIndex(String colHeader)
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.
|
default int |
getRowIndex(String header)
Gets the row index of the row with the given header.
|
default 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.
|
default C |
insertColumn(int col)
Inserts a column (with no header) at the given position in the table.
|
default C |
insertColumn(int col,
String colHeader)
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.
|
default List<C> |
insertColumns(int col,
String... headers)
Inserts a block of columns with the specified headers at the given position
in the table.
|
default void |
insertRow(int row)
Inserts a row (with no header) at the given position in the table.
|
default void |
insertRow(int row,
String header)
Inserts a row with the specified header at the given position in the table.
|
default void |
insertRows(int row,
int count)
Inserts a block of rows (with no headers) at the given position in the
table.
|
default void |
insertRows(int row,
String... headers)
Inserts a block of rows with the specified headers at the given position in
the table.
|
default boolean |
isEmpty()
Gets whether the table is empty.
|
default Iterator<C> |
iterator()
Returns an iterator over the columns in the table in proper sequence.
|
default 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.
|
default ListIterator<C> |
listIterator()
Returns a list iterator over the columns in the table (in proper sequence).
|
default 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.
|
default boolean |
remove(Object column)
Removes the first occurrence of the specified column from the table, if it
is present.
|
default boolean |
removeAll(Collection<?> c)
Removes from the table all of its columns that are contained in the
specified collection.
|
default C |
removeColumn(int col)
Removes the column at the given position from the table.
|
default C |
removeColumn(String colHeader)
Removes the first column with the given header from the table.
|
default List<C> |
removeColumns(int col,
int count)
Removes a block of columns starting at the given position from the table.
|
default List<C> |
removeColumns(String... colHeaders)
Removes the first columns with the given headers from the table.
|
default void |
removeRow(int row)
Removes the row at the given position from the table.
|
default 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.
|
default void |
removeRows(String... headers)
Removes the first rows with the given headers from the table.
|
default 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.
|
default 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.
|
default void |
setColumnHeader(int col,
String colHeader)
Sets the column header at the given column.
|
default 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.
|
default List<C> |
subList(int fromCol,
int toCol)
Returns a view of the portion of the table between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
default Object[] |
toArray()
Returns an array containing all of the columns in the table in proper
sequence (from first to last column).
|
default <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, spliterator
parallelStream, removeIf, stream
default int getColumnCount()
void setColumnCount(int colCount)
default C appendColumn()
default C appendColumn(String colHeader)
default List<C> appendColumns(int count)
default List<C> appendColumns(String... colHeaders)
default C insertColumn(int col)
default C insertColumn(int col, String colHeader)
List<C> insertColumns(int col, int count)
default List<C> insertColumns(int col, String... headers)
default C removeColumn(int col)
default C removeColumn(String colHeader)
default List<C> removeColumns(int col, int count)
default List<C> removeColumns(String... colHeaders)
int getRowCount()
void setRowCount(int rowCount)
default void appendRow()
default void appendRow(String header)
default void appendRows(int count)
default void appendRows(String... headers)
default void insertRow(int row)
default void insertRow(int row, String header)
default void insertRows(int row, int count)
default void insertRows(int row, String... headers)
default void removeRow(int row)
default void removeRow(String header)
void removeRows(int row, int count)
default void removeRows(String... headers)
default void setDimensions(int colCount, int rowCount)
default String getColumnHeader(int col)
default void setColumnHeader(int col, String colHeader)
default int getColumnIndex(String colHeader)
String getRowHeader(int row)
void setRowHeader(int row, String header)
default int getRowIndex(String header)
default void set(int col, int row, T value)
default T get(int col, int row)
int size()
default boolean isEmpty()
default boolean contains(Object column)
default Iterator<C> iterator()
default Object[] toArray()
default <A> A[] toArray(A[] a)
default 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.
default boolean remove(Object column)
default boolean containsAll(Collection<?> c)
containsAll
in interface Collection<C extends Column<? extends T>>
containsAll
in interface List<C extends Column<? extends T>>
default boolean addAll(Collection<? extends C> c)
Updates the row count if necessary, and scales the columns to match the row count if necessary.
default 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.
default boolean removeAll(Collection<?> c)
default 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)
default int indexOf(Object column)
default int lastIndexOf(Object column)
lastIndexOf
in interface List<C extends Column<? extends T>>
default ListIterator<C> listIterator()
listIterator
in interface List<C extends Column<? extends T>>
default ListIterator<C> listIterator(int col)
listIterator
in interface List<C extends Column<? extends T>>
Copyright © 2015–2022 SciJava. All rights reserved.