| java.lang.Object prefuse.data.tuple.AbstractTupleSet prefuse.data.Table
All known Subclasses: prefuse.data.CascadedTable,
Table | public class Table extends AbstractTupleSet implements ColumnListener(Code) | | A Table organizes a collection of data into rows and columns, each row
containing a data record, and each column containing data values for a
named data field with a specific data type. Table data can be accessed
directly using the row number and column name, or rows can be treated
in an object-oriented fashion using
prefuse.data.Tuple instances that represent a single row of data in the table. As such,
tables implement the
prefuse.data.tuple.TupleSet interface.
Table rows can be inserted or deleted. In any case, none of the other
existing table rows are effected by an insertion or deletion. A deleted
row simply becomes invalid--any subsequent attempts to access the row
either directly or through a pre-existing Tuple instance will result
in an exception. However, if news rows are later added to the table,
the row number for previously deleted nodes can be reused. In fact, the
lower row number currently unused is assigned to the new row. This results
in an efficient reuse of the table rows, but carries an important side
effect -- rows do not necesarily maintain the order in which they were
added once deletions have occurred on the table. If not deletions
occur, the ordering of table rows will reflect the order in which
rows were added to the table.
Collections of table rows can be accessed using both iterators over
the actual row numbers and iterators over the Tuple instances that
encapsulate access to that row. Both types of iteration can also be
filtered by providing a
prefuse.data.expression.Predicate ,
allowing tables to be queried for specific values.
Columns (alternativele referred to as data fields) can be added to
the Table using
Table.addColumn(String,Class) and a host of
similar methods. This method will automatically determine the right
kind of backing column instance to use. Furthermore, Table columns
can be specified using a
Schema instance, which describes
the column names, data types, and default values. The Table class
also maintains its own internal Schema, which be accessed (in a
read-only way) using the
Table.getSchema() method.
Tables also support additional structures. The
ColumnMetadata class returned by the
Table.getMetadata(String) method supports
calculation of different statistics for a column, including minimum
and maximum values, and the number of unique data values in the column.
prefuse.data.util.Index instances can be created and retrieved
using the
Table.index(String) method and retrieved without triggering
creation using
Table.getIndex(String) method. An index keeps a
sorted collection of all data values in a column, accelerating the creation
of filtered iterators by optimizing query calculations and also providing
faster computation of many of the
ColumnMetadata methods. If
you will be issuing a number of queries (i.e., requesting filtered
iterators) dependent on the values of a given column, indexing that column
may result in a significant performance increase, though at the cost
of storing and maintaining the backing index structure.
author: jeffrey heer |
Inner Class :protected static class ColumnEntry | |
Constructor Summary | |
public | Table() Create a new, empty Table. | public | Table(int nrows, int ncols) Create a new Table with a given number of rows, and the starting
capacity for a given number of columns. | protected | Table(int nrows, int ncols, Class tupleType) Create a new Table. |
Method Summary | |
public void | addColumn(String name, Class type) Add a column with the given name and data type to this table. | public void | addColumn(String name, Class type, Object defaultValue) Add a column with the given name and data type to this table. | public void | addColumn(String name, String expr) Add a derived column to this table, using an Expression instance to
dynamically calculate the column data values.
Parameters: name - the data field name for the column Parameters: expr - a String expression in the prefuse expression language, tobe parsed into an prefuse.data.expression.Expression instance.The string is parsed by theprefuse.data.expression.parser.ExpressionParser. | public void | addColumn(String name, Expression expr) Add a derived column to this table, using an Expression instance to
dynamically calculate the column data values. | protected void | addColumn(String name, Column col) Internal method for adding a column. | public void | addConstantColumn(String name, Class type, Object dflt) Add a constant column to this table, which returns one constant value
for all column rows. | public int | addRow() Add a row to this table. | public void | addRows(int nrows) Add a given number of rows to this table. | public void | addTableListener(TableListener listnr) Add a table listener to this table. | public Tuple | addTuple(Tuple t) Add a Tuple to this table. | public boolean | canGet(String field, Class type) Check if the get method for the given data field returns
values that are compatible with a given target type.
Parameters: field - the data field to check Parameters: type - a Class instance to check for compatibility with thedata field values. | final public boolean | canGetBoolean(String field) Check if the given data field can return primitive boolean
values.
Parameters: field - the data field to check true if the data field can return primitive boolean values, false otherwise. | final public boolean | canGetDate(String field) Check if the given data field can return primitive Date
values.
Parameters: field - the data field to check true if the data field can return primitive Date values, false otherwise. | final public boolean | canGetDouble(String field) Check if the given data field can return primitive double
values.
Parameters: field - the data field to check true if the data field can return primitive double values, false otherwise. | final public boolean | canGetFloat(String field) Check if the given data field can return primitive float
values.
Parameters: field - the data field to check true if the data field can return primitive float values, false otherwise. | final public boolean | canGetInt(String field) Check if the given data field can return primitive int
values.
Parameters: field - the data field to check true if the data field can return primitive int values, false otherwise. | final public boolean | canGetLong(String field) Check if the given data field can return primitive long
values.
Parameters: field - the data field to check true if the data field can return primitive long values, false otherwise. | final public boolean | canGetString(String field) Check if the given data field can return primitive String
values.
Parameters: field - the data field to check true if the data field can return primitive String values, false otherwise. | public boolean | canSet(String field, Class type) Check if the set method for the given data field can
accept values of a given target type.
Parameters: field - the data field to check Parameters: type - a Class instance to check for compatibility with thedata field values. | final public boolean | canSetBoolean(String field) Check if the setBoolean method can safely be used for the
given data field. | final public boolean | canSetDate(String field) Check if the setDate method can safely be used for the
given data field. | final public boolean | canSetDouble(String field) Check if the setDouble method can safely be used for the
given data field. | final public boolean | canSetFloat(String field) Check if the setFloat method can safely be used for the
given data field. | final public boolean | canSetInt(String field) Check if the setInt method can safely be used for the
given data field. | final public boolean | canSetLong(String field) Check if the setLong method can safely be used for the
given data field. | final public boolean | canSetString(String field) Check if the setString method can safely be used for the
given data field. | public void | clear() Clear this table, removing all rows. | public void | columnChanged(Column src, int idx, boolean prev) | public void | columnChanged(Column src, int idx, double prev) | public void | columnChanged(Column src, int idx, float prev) | public void | columnChanged(Column src, int idx, int prev) | public void | columnChanged(Column src, int idx, long prev) | public void | columnChanged(Column src, int idx, Object prev) | public void | columnChanged(Column src, int type, int start, int end) | public boolean | containsTuple(Tuple t) Indicates if this table contains the given Tuple instance. | protected void | fireTableEvent(int row0, int row1, int col, int type) Fire a table event to notify listeners. | public Object | get(int row, String field) Get the data value at the given row and field as an Object.
Parameters: row - the table row to get Parameters: field - the data field to retrieve the data value as an Object. | public Object | get(int row, int col) Get the data value at the given row and column numbers as an Object.
Parameters: row - the row number Parameters: col - the column number the data value as an Object. | final public boolean | getBoolean(int row, String field) Get the data value at the given row and field as a
boolean . | final public boolean | getBoolean(int row, int col) Get the data value at the given row and field as a
boolean . | public Column | getColumn(int col) Get the column at the given column number. | public Column | getColumn(String field) | public int | getColumnCount() Get the number of columns / data fields in this table. | public String | getColumnName(int col) Get the data field name of the column at the given column number. | protected Iterator | getColumnNames() | public int | getColumnNumber(String field) Get the column number for a given data field name. | public int | getColumnNumber(Column col) Get the column number for the given Column instance. | public int | getColumnRow(int row, int col) Get the row value for accessing an underlying Column instance,
corresponding to the given table cell. | public Class | getColumnType(int col) Get the data type of the column at the given column index. | public Class | getColumnType(String field) Get the data type of the column with the given data field name. | protected Iterator | getColumns() | final public Date | getDate(int row, String field) Get the data value at the given row and field as a
Date . | final public Date | getDate(int row, int col) Get the data value at the given row and field as a
Date . | public Object | getDefault(String field) Get the default value for the given data field. | final public double | getDouble(int row, String field) Get the data value at the given row and field as a
double . | final public double | getDouble(int row, int col) Get the data value at the given row and field as a
double . | final public float | getFloat(int row, String field) Get the data value at the given row and field as a
float . | final public float | getFloat(int row, int col) Get the data value at the given row and field as a
float . | public Index | getIndex(String field) Retrieve, without creating, an index for the given data field. | protected Index | getIndex(String field, Class expType, boolean create) Internal method for index creation and retrieval. | final public int | getInt(int row, String field) Get the data value at the given row and field as an
int . | final public int | getInt(int row, int col) Get the data value at the given row and field as an
int . | final public long | getLong(int row, String field) Get the data value at the given row and field as a
long . | final public long | getLong(int row, int col) Get the data value at the given row and field as an
long . | public int | getMaximumRow() Get the maximum row index currently in use by this Table. | public ColumnMetadata | getMetadata(String field) Return a metadata instance providing summary information about a column. | public int | getMinimumRow() Get the minimum row index currently in use by this Table. | public int | getModificationCount() Get the number of times this Table has been modified. | public int | getRowCount() Get the number of rows in the table. | public Schema | getSchema() Returns this Table's schema. | final public String | getString(int row, String field) Get the data value at the given row and field as a
String . | final public String | getString(int row, int col) Get the data value at the given row and field as a
String . | public int | getTableRow(int colrow, int col) Get the row number for this table given a row number for a backing
data column and the column number for the data column. | public Tuple | getTuple(int row) Get the Tuple instance providing object-oriented access to the given
table row. | public int | getTupleCount() Get the number of tuples in this table. | protected void | handleColumnChanged(Column c, int start, int end) Handle a column change event. | protected boolean | hasColumn(String name) Internal method indicating if the given data field is included as a
data column. | public Index | index(String field) Create (if necessary) and return an index over the given data field.
The first call to this method with a given field name will cause the
index to be created and stored. | protected void | invalidateSchema() Invalidates this table's cached schema. | public boolean | isAddColumnSupported() Returns true, as this table supports the addition of new data fields. | public boolean | isCellEditable(int row, int col) Indicates if the value of the given table cell can be changed. | public boolean | isValidRow(int row) Indicates if the given row number corresponds to a valid table row. | public TableIterator | iterator() Return a TableIterator over the rows of this table. | public TableIterator | iterator(IntIterator rows) Return a TableIterator over the given rows of this table. | public IntIterator | rangeSortedBy(String field, int lo, int hi, int indexType) Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. | public IntIterator | rangeSortedBy(String field, long lo, long hi, int indexType) Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. | public IntIterator | rangeSortedBy(String field, float lo, float hi, int indexType) Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. | public IntIterator | rangeSortedBy(String field, double lo, double hi, int indexType) Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. | public IntIterator | rangeSortedBy(String field, Object lo, Object hi, int indexType) Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. | public void | remove(Predicate filter) Removes all table rows that meet the input predicate filter. | public void | removeAllTableListeners() Removes all table listeners from this table. | protected Column | removeColumn(int idx) Internal method for removing a column. | public Column | removeColumn(String field) | public void | removeColumn(Column c) | public boolean | removeIndex(String field) Remove the Index associated with the given data field / column name. | public boolean | removeRow(int row) Removes a row from this table. | public void | removeTableListener(TableListener listnr) Remove a table listener from this table. | public boolean | removeTuple(Tuple t) Remove a tuple from this table. | protected void | renumberColumns() Internal method that re-numbers columns upon column removal. | public void | revertToDefault(int row, String field) Revert this tuple's value for the given field to the default value
for the field. | public IntIterator | rows() Get an interator over the row numbers of this table. | public IntIterator | rows(Predicate filter) Get a filtered iterator over the row numbers of this table, returning
only the rows whose tuples match the given filter predicate. | public IntIterator | rows(boolean reverse) Get an interator over the row numbers of this table. | public IntIterator | rowsSortedBy(String field, boolean ascend) Get an iterator over the rows of this table, sorted by the given data
field. | public Table | select(Predicate filter, Sort sort) Query this table for a filtered, sorted subset of this table. | public void | set(int row, String field, Object val) Set the value of a given row and data field.
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value for the field. | public void | set(int row, int col, Object val) Set the value of at the given row and column numbers.
Parameters: row - the row number Parameters: col - the column number Parameters: val - the value for the field. | final public void | setBoolean(int row, String field, boolean val) Set the data value of the given row and field as a
boolean . | final public void | setBoolean(int row, int col, boolean val) Set the data value of the given row and field as a
boolean . | final public void | setDate(int row, String field, Date val) Set the data value of the given row and field as a
Date . | final public void | setDate(int row, int col, Date val) Set the data value of the given row and field as a
Date . | final public void | setDouble(int row, String field, double val) Set the data value of the given row and field as a
double . | final public void | setDouble(int row, int col, double val) Set the data value of the given row and field as a
double . | final public void | setFloat(int row, String field, float val) Set the data value of the given row and field as a
float . | final public void | setFloat(int row, int col, float val) Set the data value of the given row and field as a
float . | final public void | setInt(int row, String field, int val) Set the data value of the given row and field as an
int . | final public void | setInt(int row, int col, int val) Set the data value of the given row and field as an
int . | final public void | setLong(int row, String field, long val) Set the data value of the given row and field as a
long . | final public void | setLong(int row, int col, long val) Set the data value of the given row and field as an
long . | final public void | setString(int row, String field, String val) Set the data value of the given row and field as a
String . | final public void | setString(int row, int col, String val) Set the data value of the given row and field as a
String . | public Tuple | setTuple(Tuple t) Clears the contents of this table and then attempts to add the given
Tuple instance. | public void | setTupleManager(TupleManager tm) Sets the TupleManager used by this Table. | public String | toString() | public Iterator | tuples() Get an iterator over the tuples in this table. | public Iterator | tuples(IntIterator rows) Get an iterator over the tuples for the given rows in this table. | public Iterator | tuplesReversed() Get an iterator over the tuples in this table in reverse order. | protected void | updateRowCount() Internal method that updates the row counts for local data columns. |
m_entries | protected HashMap m_entries(Code) | | Mapping between column names and column entries
containing column, metadata, and index references
|
m_lastCol | protected int m_lastCol(Code) | | Memoize the index of the last column operated on,
used to expedite handling of column updates.
|
m_modCount | protected int m_modCount(Code) | | Tracks the number of edits of this table
|
m_names | protected ArrayList m_names(Code) | | Column names for locally store data columns
|
m_schema | protected Schema m_schema(Code) | | A cached schema instance, loaded lazily
|
m_tuples | protected TupleManager m_tuples(Code) | | manager for tuples, which are object representations for rows
|
Table | public Table()(Code) | | Create a new, empty Table. Rows can be added to the table using
the
Table.addRow() method.
|
Table | public Table(int nrows, int ncols)(Code) | | Create a new Table with a given number of rows, and the starting
capacity for a given number of columns.
Parameters: nrows - the starting number of table rows Parameters: ncols - the starting capacity for columns |
Table | protected Table(int nrows, int ncols, Class tupleType)(Code) | | Create a new Table.
Parameters: nrows - the starting number of table rows Parameters: ncols - the starting capacity for columns Parameters: tupleType - the class of the Tuple instances to use |
addColumn | protected void addColumn(String name, Column col)(Code) | | Internal method for adding a column.
Parameters: name - the name of the column Parameters: col - the actual Column instance |
addConstantColumn | public void addConstantColumn(String name, Class type, Object dflt)(Code) | | Add a constant column to this table, which returns one constant value
for all column rows.
Parameters: name - the data field name for the column Parameters: type - the data type, as a Java Class, for the column Parameters: dflt - the default value for column data values |
addRow | public int addRow()(Code) | | Add a row to this table. All data columns will be notified and will
take on the appropriate default values for the added row.
the row number of the newly added row |
addRows | public void addRows(int nrows)(Code) | | Add a given number of rows to this table. All data columns will be
notified and will take on the appropriate default values for the
added rows.
Parameters: nrows - the number of rows to add. |
addTableListener | public void addTableListener(TableListener listnr)(Code) | | Add a table listener to this table.
Parameters: listnr - the listener to add |
addTuple | public Tuple addTuple(Tuple t)(Code) | | Add a Tuple to this table. If the Tuple is already a member of this
table, nothing is done and null is returned. If the Tuple is not
a member of this Table but has a compatible data schema, as
determined by
Schema.isAssignableFrom(Schema) , a new row
is created, the Tuple's values are copied, and the new Tuple that
is a member of this Table is returned. If the data schemas are not
compatible, nothing is done and null is returned.
Parameters: t - the Tuple to "add" to this table the actual Tuple instance added to this table, or null ifno new Tuple has been added See Also: prefuse.data.tuple.TupleSet.addTuple(prefuse.data.Tuple) |
canGet | public boolean canGet(String field, Class type)(Code) | | Check if the get method for the given data field returns
values that are compatible with a given target type.
Parameters: field - the data field to check Parameters: type - a Class instance to check for compatibility with thedata field values. true if the data field is compatible with provided type,false otherwise. If the value is true, objects returned bythe Table.get(int,String) can be cast to the given type. See Also: Table.get(int,String) |
canGetBoolean | final public boolean canGetBoolean(String field)(Code) | | Check if the given data field can return primitive boolean
values.
Parameters: field - the data field to check true if the data field can return primitive boolean values, false otherwise. If true, the Table.getBoolean(int,String)method can be used safely. |
canGetDate | final public boolean canGetDate(String field)(Code) | | Check if the given data field can return primitive Date
values.
Parameters: field - the data field to check true if the data field can return primitive Date values, false otherwise. If true, the Table.getDate(int,String)method can be used safely. |
canGetDouble | final public boolean canGetDouble(String field)(Code) | | Check if the given data field can return primitive double
values.
Parameters: field - the data field to check true if the data field can return primitive double values, false otherwise. If true, the Table.getDouble(int,String)method can be used safely. |
canGetFloat | final public boolean canGetFloat(String field)(Code) | | Check if the given data field can return primitive float
values.
Parameters: field - the data field to check true if the data field can return primitive float values, false otherwise. If true, the Table.getFloat(int,String)method can be used safely. |
canGetInt | final public boolean canGetInt(String field)(Code) | | Check if the given data field can return primitive int
values.
Parameters: field - the data field to check true if the data field can return primitive int values, false otherwise. If true, the Table.getInt(int,String)method can be used safely. |
canGetLong | final public boolean canGetLong(String field)(Code) | | Check if the given data field can return primitive long
values.
Parameters: field - the data field to check true if the data field can return primitive long values, false otherwise. If true, the Table.getLong(int,String)method can be used safely. |
canGetString | final public boolean canGetString(String field)(Code) | | Check if the given data field can return primitive String
values.
Parameters: field - the data field to check true if the data field can return primitive String values, false otherwise. If true, the Table.getString(int,String)method can be used safely. |
canSet | public boolean canSet(String field, Class type)(Code) | | Check if the set method for the given data field can
accept values of a given target type.
Parameters: field - the data field to check Parameters: type - a Class instance to check for compatibility with thedata field values. true if the data field is compatible with provided type,false otherwise. If the value is true, objects of the given typecan be used as parameters of the Table.set(int,String,Object)method. See Also: Table.set(int,String,Object) |
canSetBoolean | final public boolean canSetBoolean(String field)(Code) | | Check if the setBoolean method can safely be used for the
given data field.
Parameters: field - the data field to check true if the Table.setBoolean(int,String,boolean) method cansafely be used for the given field, false otherwise. |
canSetDate | final public boolean canSetDate(String field)(Code) | | Check if the setDate method can safely be used for the
given data field.
Parameters: field - the data field to check true if the Table.setDate(int,String,Date) method cansafely be used for the given field, false otherwise. |
canSetDouble | final public boolean canSetDouble(String field)(Code) | | Check if the setDouble method can safely be used for the
given data field.
Parameters: field - the data field to check true if the Table.setDouble(int,String,double) method cansafely be used for the given field, false otherwise. |
canSetFloat | final public boolean canSetFloat(String field)(Code) | | Check if the setFloat method can safely be used for the
given data field.
Parameters: field - the data field to check true if the Table.setFloat(int,String,float) method cansafely be used for the given field, false otherwise. |
canSetInt | final public boolean canSetInt(String field)(Code) | | Check if the setInt method can safely be used for the
given data field.
Parameters: field - the data field to check true if the Table.setInt(int,String,int) method can safelybe used for the given field, false otherwise. |
canSetLong | final public boolean canSetLong(String field)(Code) | | Check if the setLong method can safely be used for the
given data field.
Parameters: field - the data field to check true if the Table.setLong(int,String,long) method cansafely be used for the given field, false otherwise. |
canSetString | final public boolean canSetString(String field)(Code) | | Check if the setString method can safely be used for the
given data field.
Parameters: field - the data field to check true if the Table.setString(int,String,String) method cansafely be used for the given field, false otherwise. |
get | public Object get(int row, String field)(Code) | | Get the data value at the given row and field as an Object.
Parameters: row - the table row to get Parameters: field - the data field to retrieve the data value as an Object. The concrete type of thisObject is dependent on the underlying data column used. See Also: Table.canGet(String,Class) See Also: Table.getColumnType(String) |
get | public Object get(int row, int col)(Code) | | Get the data value at the given row and column numbers as an Object.
Parameters: row - the row number Parameters: col - the column number the data value as an Object. The concrete type of thisObject is dependent on the underlying data column used. See Also: Table.canGet(String,Class) See Also: Table.getColumnType(int) |
getBoolean | final public boolean getBoolean(int row, String field)(Code) | | Get the data value at the given row and field as a
boolean .
Parameters: row - the table row to retrieve Parameters: field - the data field to retrieve See Also: Table.canGetBoolean(String) |
getBoolean | final public boolean getBoolean(int row, int col)(Code) | | Get the data value at the given row and field as a
boolean .
Parameters: row - the table row to retrieve Parameters: col - the column number of the data field to get See Also: Table.canGetBoolean(String) |
getColumn | public Column getColumn(int col)(Code) | | Get the column at the given column number.
Parameters: col - the column number the Column instance |
getColumn | public Column getColumn(String field)(Code) | | Get the column with the given data field name
Parameters: field - the data field name of the column the Column instance |
getColumnCount | public int getColumnCount()(Code) | | Get the number of columns / data fields in this table.
the number of columns |
getColumnName | public String getColumnName(int col)(Code) | | Get the data field name of the column at the given column number.
Parameters: col - the column number the data field name of the column |
getColumnNames | protected Iterator getColumnNames()(Code) | | Internal method that returns an iterator over column names
an iterator over column name |
getColumnNumber | public int getColumnNumber(String field)(Code) | | Get the column number for a given data field name.
Parameters: field - the name of the column to lookup the column number of the column, or -1 if the name is not found |
getColumnNumber | public int getColumnNumber(Column col)(Code) | | Get the column number for the given Column instance.
Parameters: col - the Column instance to lookup the column number of the column, or -1 if the name is not found |
getColumnRow | public int getColumnRow(int row, int col)(Code) | | Get the row value for accessing an underlying Column instance,
corresponding to the given table cell. For basic tables this just
returns the input row value. However, for tables that inherit
data columns from a parent table and present a filtered view on
this data, a mapping between the row numbers of the table and
the row numbers of the backing data column is needed. In those cases,
this method returns the result of that mapping. The method
Table.getTableRow(int,int) accesses this map in the reverse
direction.
Parameters: row - the table row to lookup Parameters: col - the table column to lookup the column row number for accessing the desired table cell |
getColumnType | public Class getColumnType(int col)(Code) | | Get the data type of the column at the given column index.
Parameters: col - the column index the data type (as a Java Class) of the column |
getColumnType | public Class getColumnType(String field)(Code) | | Get the data type of the column with the given data field name.
Parameters: field - the column / data field name the data type (as a Java Class) of the column |
getColumns | protected Iterator getColumns()(Code) | | Internal method that returns an iterator over columns
an iterator over columns |
getDate | final public Date getDate(int row, String field)(Code) | | Get the data value at the given row and field as a
Date .
Parameters: row - the table row to retrieve Parameters: field - the data field to retrieve See Also: Table.canGetDate(String) |
getDate | final public Date getDate(int row, int col)(Code) | | Get the data value at the given row and field as a
Date .
Parameters: row - the table row to retrieve Parameters: col - the column number of the data field to retrieve See Also: Table.canGetDate(String) |
getDefault | public Object getDefault(String field)(Code) | | Get the default value for the given data field.
Parameters: field - the data field the default value, as an Object, used to populate rowsof the data field. |
getDouble | final public double getDouble(int row, String field)(Code) | | Get the data value at the given row and field as a
double .
Parameters: row - the table row to retrieve Parameters: field - the data field to retrieve See Also: Table.canGetDouble(String) |
getDouble | final public double getDouble(int row, int col)(Code) | | Get the data value at the given row and field as a
double .
Parameters: row - the table row to retrieve Parameters: col - the column number of the data field to get See Also: Table.canGetDouble(String) |
getFloat | final public float getFloat(int row, String field)(Code) | | Get the data value at the given row and field as a
float .
Parameters: row - the table row to retrieve Parameters: field - the data field to retrieve See Also: Table.canGetFloat(String) |
getFloat | final public float getFloat(int row, int col)(Code) | | Get the data value at the given row and field as a
float .
Parameters: row - the table row to retrieve Parameters: col - the column number of the data field to get See Also: Table.canGetFloat(String) |
getIndex | public Index getIndex(String field)(Code) | | Retrieve, without creating, an index for the given data field.
Parameters: field - the data field name of the column the stored index for the column, or null if no index hasbeen created |
getIndex | protected Index getIndex(String field, Class expType, boolean create)(Code) | | Internal method for index creation and retrieval.
Parameters: field - the data field name of the column Parameters: expType - the expected data type of the index Parameters: create - indicates whether or not a new index should be createdif none currently exists for the given data field the Index for the given data field |
getInt | final public int getInt(int row, String field)(Code) | | Get the data value at the given row and field as an
int .
Parameters: row - the table row to retrieve Parameters: field - the data field to retrieve See Also: Table.canGetInt(String) |
getInt | final public int getInt(int row, int col)(Code) | | Get the data value at the given row and field as an
int .
Parameters: row - the table row to retrieve Parameters: col - the column number of the data field to retrieve See Also: Table.canGetInt(String) |
getLong | final public long getLong(int row, String field)(Code) | | Get the data value at the given row and field as a
long .
Parameters: row - the table row to retrieve Parameters: field - the data field to retrieve See Also: Table.canGetLong(String) |
getLong | final public long getLong(int row, int col)(Code) | | Get the data value at the given row and field as an
long .
Parameters: row - the table row to retrieve Parameters: col - the column number of the data field to retrieve See Also: Table.canGetLong(String) |
getMaximumRow | public int getMaximumRow()(Code) | | Get the maximum row index currently in use by this Table.
the maximum row index |
getMetadata | public ColumnMetadata getMetadata(String field)(Code) | | Return a metadata instance providing summary information about a column.
Parameters: field - the data field name of the column the columns' associated ColumnMetadata instance |
getMinimumRow | public int getMinimumRow()(Code) | | Get the minimum row index currently in use by this Table.
the minimum row index |
getModificationCount | public int getModificationCount()(Code) | | Get the number of times this Table has been modified. Adding rows,
deleting rows, and updating table cell values all contribute to
this count.
the number of modifications to this table |
getRowCount | public int getRowCount()(Code) | | Get the number of rows in the table.
the number of rows |
getSchema | public Schema getSchema()(Code) | | Returns this Table's schema. The returned schema will be
locked, which means that any attempts to edit the returned schema
by adding additional columns will result in a runtime exception.
If this Table subsequently has columns added or removed, this will not
be reflected in the returned schema. Instead, this method will need to
be called again to get a current schema. Accordingly, it is not
recommended that Schema instances returned by this method be stored
or reused across scopes unless that exact schema snapshot is
desired.
a copy of this Table's schema |
getString | final public String getString(int row, String field)(Code) | | Get the data value at the given row and field as a
String .
Parameters: row - the table row to retrieve Parameters: field - the data field to retrieve See Also: Table.canGetString(String) |
getString | final public String getString(int row, int col)(Code) | | Get the data value at the given row and field as a
String .
Parameters: row - the table row to retrieve Parameters: col - the column number of the data field to retrieve See Also: Table.canGetString(String) |
getTableRow | public int getTableRow(int colrow, int col)(Code) | | Get the row number for this table given a row number for a backing
data column and the column number for the data column. For basic
tables this just returns the column row value. However, for tables that
inherit data columns from a parent table and present a filtered view on
this data, a mapping between the row numbers of the table and
the row numbers of the backing data column is needed. In those cases,
this method returns the result of this mapping, in the direction of
the backing column rows to the table rows of the cascaded table. The
method
Table.getColumnRow(int,int) accesses this map in the reverse
direction.
Parameters: colrow - the row of the backing data column Parameters: col - the table column to lookup. the table row number for accessing the desired table cell |
getTuple | public Tuple getTuple(int row)(Code) | | Get the Tuple instance providing object-oriented access to the given
table row.
Parameters: row - the table row the Tuple for the given table row |
handleColumnChanged | protected void handleColumnChanged(Column c, int start, int end)(Code) | | Handle a column change event.
Parameters: c - the modified column Parameters: start - the starting row of the modified range Parameters: end - the ending row (inclusive) of the modified range |
hasColumn | protected boolean hasColumn(String name)(Code) | | Internal method indicating if the given data field is included as a
data column.
|
index | public Index index(String field)(Code) | | Create (if necessary) and return an index over the given data field.
The first call to this method with a given field name will cause the
index to be created and stored. Subsequent calls will simply return
the stored index. To attempt to retrieve an index without triggering
creation of a new index, use the
Table.getIndex(String) method.
Parameters: field - the data field name of the column to index the index over the specified data column |
invalidateSchema | protected void invalidateSchema()(Code) | | Invalidates this table's cached schema. This method should be called
whenever columns are added or removed from this table.
|
isCellEditable | public boolean isCellEditable(int row, int col)(Code) | | Indicates if the value of the given table cell can be changed.
Parameters: row - the row number Parameters: col - the column number true if the value can be edited/changed, false otherwise |
isValidRow | public boolean isValidRow(int row)(Code) | | Indicates if the given row number corresponds to a valid table row.
Parameters: row - the row number to check for validity true if the row is valid, false if it is not |
iterator | public TableIterator iterator()(Code) | | Return a TableIterator over the rows of this table.
a TableIterator over this table |
iterator | public TableIterator iterator(IntIterator rows)(Code) | | Return a TableIterator over the given rows of this table.
Parameters: rows - an iterator over the table rows to visit a TableIterator over this table |
rangeSortedBy | public IntIterator rangeSortedBy(String field, int lo, int hi, int indexType)(Code) | | Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. A new index over the
data field will be created if it doesn't already exist.
Parameters: field - the data field for determining the bounded range Parameters: lo - the minimum range value Parameters: hi - the maximum range value Parameters: indexType - indicate the sort order and inclusivity/exclusivityof the range bounds, using the constants of theprefuse.data.util.Index class. an iterator over a range of table rows, determined by a sorted bounded range of a data field |
rangeSortedBy | public IntIterator rangeSortedBy(String field, long lo, long hi, int indexType)(Code) | | Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. A new index over the
data field will be created if it doesn't already exist.
Parameters: field - the data field for determining the bounded range Parameters: lo - the minimum range value Parameters: hi - the maximum range value Parameters: indexType - indicate the sort order and inclusivity/exclusivityof the range bounds, using the constants of theprefuse.data.util.Index class. an iterator over a range of table rows, determined by a sorted bounded range of a data field |
rangeSortedBy | public IntIterator rangeSortedBy(String field, float lo, float hi, int indexType)(Code) | | Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. A new index over the
data field will be created if it doesn't already exist.
Parameters: field - the data field for determining the bounded range Parameters: lo - the minimum range value Parameters: hi - the maximum range value Parameters: indexType - indicate the sort order and inclusivity/exclusivityof the range bounds, using the constants of theprefuse.data.util.Index class. an iterator over a range of table rows, determined by a sorted bounded range of a data field |
rangeSortedBy | public IntIterator rangeSortedBy(String field, double lo, double hi, int indexType)(Code) | | Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. A new index over the
data field will be created if it doesn't already exist.
Parameters: field - the data field for determining the bounded range Parameters: lo - the minimum range value Parameters: hi - the maximum range value Parameters: indexType - indicate the sort order and inclusivity/exclusivityof the range bounds, using the constants of theprefuse.data.util.Index class. an iterator over a range of table rows, determined by a sorted bounded range of a data field |
rangeSortedBy | public IntIterator rangeSortedBy(String field, Object lo, Object hi, int indexType)(Code) | | Return an iterator over a range of rwos in this table, determined
by a bounded range for a given data field. A new index over the
data field will be created if it doesn't already exist.
Parameters: field - the data field for determining the bounded range Parameters: lo - the minimum range value Parameters: hi - the maximum range value Parameters: indexType - indicate the sort order and inclusivity/exclusivityof the range bounds, using the constants of theprefuse.data.util.Index class. an iterator over a range of table rows, determined by a sorted bounded range of a data field |
remove | public void remove(Predicate filter)(Code) | | Removes all table rows that meet the input predicate filter.
Parameters: filter - a predicate specifying which rows to remove fromthe table. |
removeAllTableListeners | public void removeAllTableListeners()(Code) | | Removes all table listeners from this table.
|
removeColumn | protected Column removeColumn(int idx)(Code) | | Internal method for removing a column.
Parameters: idx - the column number of the column to remove the removed Column instance |
removeColumn | public Column removeColumn(String field)(Code) | | Remove a data field from this table
Parameters: field - the name of the data field / column to remove the removed Column instance |
removeColumn | public void removeColumn(Column c)(Code) | | Remove a column from this table
Parameters: c - the column instance to remove |
removeIndex | public boolean removeIndex(String field)(Code) | | Remove the Index associated with the given data field / column name.
Parameters: field - the name of the column for which to remove the index true if an index was successfully removed, false if nosuch index was found |
removeRow | public boolean removeRow(int row)(Code) | | Removes a row from this table.
Parameters: row - the row to delete true if the row was successfully deleted, false if therow was already invalid |
removeTableListener | public void removeTableListener(TableListener listnr)(Code) | | Remove a table listener from this table.
Parameters: listnr - the listener to remove |
removeTuple | public boolean removeTuple(Tuple t)(Code) | | Remove a tuple from this table. If the Tuple is a member of this table,
its row is deleted from the table. Otherwise, nothing is done.
Parameters: t - the Tuple to remove from the table true if the Tuple row was successfully deleted, false if theTuple is invalid or not a member of this table See Also: prefuse.data.tuple.TupleSet.removeTuple(prefuse.data.Tuple) |
renumberColumns | protected void renumberColumns()(Code) | | Internal method that re-numbers columns upon column removal.
|
revertToDefault | public void revertToDefault(int row, String field)(Code) | | Revert this tuple's value for the given field to the default value
for the field.
Parameters: field - the data field See Also: Table.getDefault(String) |
rows | public IntIterator rows()(Code) | | Get an interator over the row numbers of this table.
an iterator over the rows of this table |
rows | public IntIterator rows(Predicate filter)(Code) | | Get a filtered iterator over the row numbers of this table, returning
only the rows whose tuples match the given filter predicate.
Parameters: filter - the filter predicate to apply a filtered iterator over the rows of this table |
rows | public IntIterator rows(boolean reverse)(Code) | | Get an interator over the row numbers of this table.
Parameters: reverse - true to iterate in rever order, false for normal order an iterator over the rows of this table |
rowsSortedBy | public IntIterator rowsSortedBy(String field, boolean ascend)(Code) | | Get an iterator over the rows of this table, sorted by the given data
field. This method will create an index over the field if one does
not yet exist.
Parameters: field - the data field to sort by Parameters: ascend - true if the iteration should proceed in an ascending(lowest to highest) sort order, false for a descending order the sorted iterator over rows of this table |
select | public Table select(Predicate filter, Sort sort)(Code) | | Query this table for a filtered, sorted subset of this table. This
operation creates an entirely new table independent of this table.
If a filtered view of this same table is preferred, use the
CascadedTable class.
Parameters: filter - the predicate filter determining which rows to includein the new table. If this value is null, all rows will be included. Parameters: sort - the sorting criteria determining the order in whichrows are added to the new table. If this value is null, the rowswill not be sorted. a new table meeting the query specification |
set | public void set(int row, String field, Object val)(Code) | | Set the value of a given row and data field.
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value for the field. If the concrete type of thisObject is not compatible with the underlying data model, anException will be thrown. Use the Table.canSet(String,Class)method to check the type-safety ahead of time. See Also: Table.canSet(String,Class) See Also: Table.getColumnType(String) |
set | public void set(int row, int col, Object val)(Code) | | Set the value of at the given row and column numbers.
Parameters: row - the row number Parameters: col - the column number Parameters: val - the value for the field. If the concrete type of thisObject is not compatible with the underlying data model, anException will be thrown. Use the Table.canSet(String,Class)method to check the type-safety ahead of time. See Also: Table.canSet(String,Class) See Also: Table.getColumnType(String) |
setBoolean | final public void setBoolean(int row, String field, boolean val)(Code) | | Set the data value of the given row and field as a
boolean .
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value to set See Also: Table.canSetBoolean(String) |
setBoolean | final public void setBoolean(int row, int col, boolean val)(Code) | | Set the data value of the given row and field as a
boolean .
Parameters: row - the table row to set Parameters: col - the column number of the data field to set Parameters: val - the value to set See Also: Table.canSetBoolean(String) |
setDate | final public void setDate(int row, String field, Date val)(Code) | | Set the data value of the given row and field as a
Date .
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value to set See Also: Table.canSetDate(String) |
setDate | final public void setDate(int row, int col, Date val)(Code) | | Set the data value of the given row and field as a
Date .
Parameters: row - the table row to set Parameters: col - the column number of the data field to set Parameters: val - the value to set See Also: Table.canSetDate(String) |
setDouble | final public void setDouble(int row, String field, double val)(Code) | | Set the data value of the given row and field as a
double .
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value to set See Also: Table.canSetDouble(String) |
setDouble | final public void setDouble(int row, int col, double val)(Code) | | Set the data value of the given row and field as a
double .
Parameters: row - the table row to set Parameters: col - the column number of the data field to set Parameters: val - the value to set See Also: Table.canSetDouble(String) |
setFloat | final public void setFloat(int row, String field, float val)(Code) | | Set the data value of the given row and field as a
float .
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value to set See Also: Table.canSetFloat(String) |
setFloat | final public void setFloat(int row, int col, float val)(Code) | | Set the data value of the given row and field as a
float .
Parameters: row - the table row to set Parameters: col - the column number of the data field to set Parameters: val - the value to set See Also: Table.canSetFloat(String) |
setInt | final public void setInt(int row, String field, int val)(Code) | | Set the data value of the given row and field as an
int .
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value to set See Also: Table.canSetInt(String) |
setInt | final public void setInt(int row, int col, int val)(Code) | | Set the data value of the given row and field as an
int .
Parameters: row - the table row to set Parameters: col - the column number of the data field to set Parameters: val - the value to set See Also: Table.canSetInt(String) |
setLong | final public void setLong(int row, String field, long val)(Code) | | Set the data value of the given row and field as a
long .
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value to set See Also: Table.canSetLong(String) |
setLong | final public void setLong(int row, int col, long val)(Code) | | Set the data value of the given row and field as an
long .
Parameters: row - the table row to set Parameters: col - the column number of the data field to set Parameters: val - the value to set See Also: Table.canSetLong(String) |
setString | final public void setString(int row, String field, String val)(Code) | | Set the data value of the given row and field as a
String .
Parameters: row - the table row to set Parameters: field - the data field to set Parameters: val - the value to set See Also: Table.canSetString(String) |
setString | final public void setString(int row, int col, String val)(Code) | | Set the data value of the given row and field as a
String .
Parameters: row - the table row to set Parameters: col - the column number of the data field to set Parameters: val - the value to set See Also: Table.canSetString(String) |
setTupleManager | public void setTupleManager(TupleManager tm)(Code) | | Sets the TupleManager used by this Table. Use this method
carefully, as it will cause all existing Tuples retrieved
from this Table to be invalidated.
Parameters: tm - the TupleManager to use |
tuples | public Iterator tuples(IntIterator rows)(Code) | | Get an iterator over the tuples for the given rows in this table.
Parameters: rows - an iterator over the table rows to visit an iterator over the selected table tuples |
tuplesReversed | public Iterator tuplesReversed()(Code) | | Get an iterator over the tuples in this table in reverse order.
an iterator over the table tuples in reverse order |
updateRowCount | protected void updateRowCount()(Code) | | Internal method that updates the row counts for local data columns.
|
Methods inherited from prefuse.data.tuple.AbstractTupleSet | public void addColumn(String name, Class type, Object defaultValue)(Code)(Java Doc) public void addColumn(String name, Class type)(Code)(Java Doc) public void addColumn(String name, Expression expr)(Code)(Java Doc) public void addColumn(String name, String expr)(Code)(Java Doc) public void addColumns(Schema schema)(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener lstnr)(Code)(Java Doc) public void addPropertyChangeListener(String key, PropertyChangeListener lstnr)(Code)(Java Doc) public void addTupleSetListener(TupleSetListener tsl)(Code)(Java Doc) protected void fireTupleEvent(Table t, int start, int end, int type)(Code)(Java Doc) protected void fireTupleEvent(Tuple t, int type)(Code)(Java Doc) protected void fireTupleEvent(Tuple[] added, Tuple[] removed)(Code)(Java Doc) public Object getClientProperty(String key)(Code)(Java Doc) public boolean isAddColumnSupported()(Code)(Java Doc) public void putClientProperty(String key, Object value)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener lstnr)(Code)(Java Doc) public void removePropertyChangeListener(String key, PropertyChangeListener lstnr)(Code)(Java Doc) public void removeTupleSetListener(TupleSetListener tsl)(Code)(Java Doc) public Iterator tuples(Predicate filter)(Code)(Java Doc) public Iterator tuples(Predicate filter, Sort sort)(Code)(Java Doc)
|
|
|