|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Table
The Table
is the base class of all infovis dataset
containers. It is basically a Column
of columns.
An abstract table manages a list of columns. Each column is an indexed container of homogeneous type such as integers (int), floats or Objects. Each column has also a name. By convention, when the name of a column starts with a '#' character (sharp sign), the column is considered "internal", i.e not user supplied. Internal columns are used to manage trees and graphs using a table structure, where the internal structure of the tree or the graph should not be confused with user supplied attributes.
Tables, like columns, also manage metadata and client data. Metadata are useful to store information about the nature of the table that could be saved along with the data, i.e. a textual description of the origin of the data. Client data is useful to store run-time information associated with the table.
Tables contain data in a similar way as database contain data. Creating a simple table containing a name, a birthdate and a salary can be done with the following code:
Table table = new DefaultTable(); StringColumn name = new StringColumn("name"); table.addColumn(name); DateColumn birthdate = new DateColumn("birthdate"); table.addColumn(birthdate); FloatColumn salary = new FloatColumn("salary"); table.addColumn(salary);
Adding new data into the table can be done using the following code:
name.addValue("Doe, John"); birthdate.addValue("12 Jan 1980 12:23:00"); salary.add(1500);
Field Summary | |
---|---|
static String |
FILTER_COLUMN
Name of the LongColumn managing the dynamic filtering, if one exists. |
static char |
INTERNAL_PREFIX
Prefixes the name of columns used for internal purposes. |
static int |
NIL
NIL value for a table index. |
static String |
SELECTION_COLUMN
Name of the BooleanColumn managing the selection, if one exists. |
Fields inherited from interface infovis.metadata.Constants |
---|
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE |
Method Summary | |
---|---|
void |
addColumn(Column c)
Adds a column. |
void |
clear()
Clears the table. |
Column |
getColumn(String name)
Returns the column of a specified name. |
Column |
getColumnAt(int index)
Returns the column at a specified index. |
int |
getColumnCount()
Returns the number of columns of the table. |
int |
getLastRow()
Returns the index of the last row in the table. |
int |
getRowCount()
Returns the number of rows in the table. |
Table |
getTable()
Returns the real table for Proxies and this for a concrete table. |
int |
indexOf(Column column)
Returns the index of a specified column. |
int |
indexOf(String name)
Returns the index of a column of a specified name. |
boolean |
isRowValid(int row)
Checks whether a specified row is valid. |
boolean |
removeColumn(Column c)
Removes a column from the table. |
RowIterator |
reverseIterator()
Returns an iterator over the columns of this table in reverse order. |
void |
setColumnAt(int i,
Column c)
Replaces the column at a specified index. |
Methods inherited from interface infovis.Column |
---|
addChangeListener, addValue, addValueOrNull, capacity, disableNotify, enableNotify, ensureCapacity, getFormat, getMaxIndex, getMinIndex, getName, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, iterator, removeChangeListener, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size |
Methods inherited from interface infovis.Metadata |
---|
getClientProperty, getMetadata |
Methods inherited from interface cern.colt.function.IntComparator |
---|
compare, equals |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnName, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Field Detail |
---|
static final int NIL
static final char INTERNAL_PREFIX
static final String SELECTION_COLUMN
static final String FILTER_COLUMN
Method Detail |
---|
int getColumnCount()
getColumnCount
in interface TableModel
void clear()
After this method, the table is almost in the same state as if it had been created afresh except it contains the same columns as before but they are all cleared.
clear
in interface Column
void addColumn(Column c)
c
- the column.Column getColumnAt(int index)
index
- the index.
void setColumnAt(int i, Column c)
i
- the index.c
- the column.int indexOf(String name)
name
- the name.
int indexOf(Column column)
column
- the column
Column getColumn(String name)
name
- the name.
boolean removeColumn(Column c)
c
- the column.
true
if the column has been removed.int getRowCount()
getRowCount
in interface TableModel
int getLastRow()
RowIterator reverseIterator()
Table getTable()
boolean isRowValid(int row)
row
- the row.
true
if it is.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |