infovis
Interface Table

All Superinterfaces:
Column, Constants, IntComparator, Metadata, RowComparator, Serializable, TableModel
All Known Subinterfaces:
DynamicTable, Tree
All Known Implementing Classes:
ColumnsVisualization, ColumnVisualization, DefaultAxisVisualization, DefaultDynamicTable, DefaultTable, DefaultTree, DefaultVisualization, DynamicTableProxy, FilteredTable, GraphVisualization, HistogramVisualization, IcicleTreeVisualization, LinkVisualization, MatrixAxisVisualization, MatrixVisualization, NodeLinkGraphVisualization, NodeLinkTreeVisualization, ParallelCoordinatesVisualization, RulerTable, RulerVisualization, ScatterPlotVisualization, StrokingVisualization, TableProxy, TimeSeriesVisualization, TreeAsGraph, TreemapVisualization, TreeProxy, TreeVisualization

public interface Table
extends Column, Metadata, TableModel

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);
 

Version:
$Revision: 1.30 $
Author:
Jean-Daniel Fekete

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

NIL

static final int NIL
NIL value for a table index.

See Also:
Constant Field Values

INTERNAL_PREFIX

static final char INTERNAL_PREFIX
Prefixes the name of columns used for internal purposes.

See Also:
Constant Field Values

SELECTION_COLUMN

static final String SELECTION_COLUMN
Name of the BooleanColumn managing the selection, if one exists.

See Also:
Constant Field Values

FILTER_COLUMN

static final String FILTER_COLUMN
Name of the LongColumn managing the dynamic filtering, if one exists.

See Also:
Constant Field Values
Method Detail

getColumnCount

int getColumnCount()
Returns the number of columns of the table.

Specified by:
getColumnCount in interface TableModel
Returns:
the number of columns of the table.

clear

void clear()
Clears the table.

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.

Specified by:
clear in interface Column

addColumn

void addColumn(Column c)
Adds a column.

Parameters:
c - the column.

getColumnAt

Column getColumnAt(int index)
Returns the column at a specified index.

Parameters:
index - the index.
Returns:
the column at a specified index or null if the index is out of range.

setColumnAt

void setColumnAt(int i,
                 Column c)
Replaces the column at a specified index.

Parameters:
i - the index.
c - the column.

indexOf

int indexOf(String name)
Returns the index of a column of a specified name.

Parameters:
name - the name.
Returns:
the index of a column of a specified name or -1 if no such column exist.

indexOf

int indexOf(Column column)
Returns the index of a specified column.

Parameters:
column - the column
Returns:
the index of a specified column or -1 if the column is not in the table.

getColumn

Column getColumn(String name)
Returns the column of a specified name.

Parameters:
name - the name.
Returns:
the column of a specified name.

removeColumn

boolean removeColumn(Column c)
Removes a column from the table.

Parameters:
c - the column.
Returns:
true if the column has been removed.

getRowCount

int getRowCount()
Returns the number of rows in the table.

Specified by:
getRowCount in interface TableModel
Returns:
the number of rows in the table.

getLastRow

int getLastRow()
Returns the index of the last row in the table.

Returns:
the index of the last row in the table

reverseIterator

RowIterator reverseIterator()
Returns an iterator over the columns of this table in reverse order.

Returns:
an iterator over the columns of this table in reverse order.

getTable

Table getTable()
Returns the real table for Proxies and this for a concrete table.

Returns:
the real table for Proxies and this for a concrete table.

isRowValid

boolean isRowValid(int row)
Checks whether a specified row is valid.

Parameters:
row - the row.
Returns:
true if it is.


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.