|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.erichseifert.gral.data.AbstractDataSource
de.erichseifert.gral.data.DataTable
public class DataTable
Creates a DataTable object. DataTable is the basic implementation of DataSource. Implemented functionality includes:
Constructor Summary | |
---|---|
DataTable(Class<? extends Number>... types)
Creates a new DataTable object. |
Method Summary | |
---|---|
void |
add(Collection<? extends Number> values)
Adds a row with the specified container's elements to the table. |
void |
add(Number... values)
Adds a row with the specified Number values to the table. |
void |
clear()
Deletes all rows this table contains. |
Number |
get(int col,
int row)
Returns the row with the specified index. |
Class<? extends Number> |
getColumnClass(int col)
Returns the data type of the specified column. |
int |
getColumnCount()
Returns the number of columns of the data source. |
int |
getRowCount()
Returns the number of rows of the data source. |
void |
remove(int row)
Removes a specified row from the table. |
Number |
set(int col,
int row,
Number value)
Sets the value of a certain cell. |
void |
sort(DataComparator... comparators)
Sorts the table rows with the specified DataComparators. |
Methods inherited from class de.erichseifert.gral.data.AbstractDataSource |
---|
addDataListener, getColumn, getRow, getStatistics, iterator, removeDataListener |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataTable(Class<? extends Number>... types)
types
- type for each columnMethod Detail |
---|
public void add(Number... values)
Number
values to the table.
The values are added in the order they are specified. If the types of
the table columns and the values do not match, an exception is thrown.
values
- values to be added as a row
IllegalArgumentException
- if the type of the
table columns and the type of the values that should be added do not matchpublic void add(Collection<? extends Number> values)
values
- values to be added as a row
IllegalArgumentException
- if the type of the
table columns and the type of the values that should be added do not matchpublic void remove(int row)
row
- Index of the row to removepublic void clear()
public Number get(int col, int row)
DataSource
col
- index of the column to returnrow
- index of the row to return
public Number set(int col, int row, Number value)
col
- Column of the cell to change.row
- Row of the cell to change.value
- New value to be set.
public int getRowCount()
DataSource
public int getColumnCount()
DataSource
public Class<? extends Number> getColumnClass(int col)
col
- Column.
public void sort(DataComparator... comparators)
comparators
- comparators used for sorting
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |