public interface MutableDataSource extends DataSource
Interface for write access to tabular data. The access includes adding, modifying, and deleting of the data.
All data can be sorted row-wise with the method
sort(DataComparator...)
. For example, this way column 1 could be
sorted ascending and column 3 descending.
DataSource
Modifier and Type | Method and Description |
---|---|
int |
add(Collection<? extends Comparable<?>> values)
Adds a row with the specified container's elements to the data sink.
|
int |
add(Comparable<?>... values)
Adds a row with the specified comparable values.
|
int |
add(Row row)
Adds the specified row to the data sink.
|
void |
clear()
Deletes all rows this data sink contains.
|
void |
remove(int row)
Removes a specified row from the data sink.
|
void |
removeLast()
Removes the last row from the data sink.
|
<T> Comparable<T> |
set(int col,
int row,
Comparable<T> value)
Sets the value of a cell specified by its column and row indexes.
|
void |
sort(DataComparator... comparators)
Sorts the data sink rows with the specified sorting rules.
|
addDataListener, get, getColumn, getColumnCount, getColumnTypes, getRow, getRowCount, getStatistics, isColumnNumeric, removeDataListener
int add(Comparable<?>... values)
IllegalArgumentException
is thrown.values
- values to be added as a row.int add(Collection<? extends Comparable<?>> values)
IllegalArgumentException
is thrown.values
- values to be added as a row.int add(Row row)
IllegalArgumentException
is thrown.row
- Row to be added.void remove(int row)
row
- Index of the row to remove.void removeLast()
void clear()
<T> Comparable<T> set(int col, int row, Comparable<T> value)
T
- Data type of the cell.col
- Column of the cell to change.row
- Row of the cell to change.value
- New value to be set.void sort(DataComparator... comparators)
comparators
- Comparators used for sorting.Copyright © 2009-2013. All Rights Reserved.