|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.tuple.AbstractTupleSet prefuse.data.Table
public class Table
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 Tuple
instances that represent a single row of data in the table. As such,
tables implement the 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 Predicate
,
allowing tables to be queried for specific values.
Columns (alternativele referred to as data fields) can be added to
the Table using 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 getSchema()
method.
Tables also support additional structures. The ColumnMetadata
class returned by the 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.
Index
instances can be created and retrieved
using the index(String)
method and retrieved without triggering
creation using 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.
Nested Class Summary | |
---|---|
protected static class |
Table.ColumnEntry
Helper class that encapsulates a map entry for a column, including the column itself and its metadata and index. |
Field Summary | |
---|---|
protected java.util.ArrayList |
m_columns
Locally stored data columns |
protected java.util.HashMap |
m_entries
Mapping between column names and column entries containing column, metadata, and index references |
protected int |
m_lastCol
Memoize the index of the last column operated on, used to expedite handling of column updates. |
protected CopyOnWriteArrayList |
m_listeners
Listeners for changes to this table |
protected int |
m_modCount
Tracks the number of edits of this table |
protected java.util.ArrayList |
m_names
Column names for locally store data columns |
protected RowManager |
m_rows
Manager for valid row indices |
protected Schema |
m_schema
A cached schema instance, loaded lazily |
protected TupleManager |
m_tuples
manager for tuples, which are object representations for rows |
Fields inherited from interface prefuse.data.tuple.TupleSet |
---|
EMPTY_ARRAY |
Constructor Summary | |
---|---|
|
Table()
Create a new, empty Table. |
|
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,
java.lang.Class tupleType)
Create a new Table. |
Method Summary | |
---|---|
void |
addColumn(java.lang.String name,
java.lang.Class type)
Add a column with the given name and data type to this table. |
void |
addColumn(java.lang.String name,
java.lang.Class type,
java.lang.Object defaultValue)
Add a column with the given name and data type to this table. |
protected void |
addColumn(java.lang.String name,
Column col)
Internal method for adding a column. |
void |
addColumn(java.lang.String name,
Expression expr)
Add a derived column to this table, using an Expression instance to dynamically calculate the column data values. |
void |
addColumn(java.lang.String name,
java.lang.String expr)
Add a derived column to this table, using an Expression instance to dynamically calculate the column data values. |
void |
addConstantColumn(java.lang.String name,
java.lang.Class type,
java.lang.Object dflt)
Add a constant column to this table, which returns one constant value for all column rows. |
int |
addRow()
Add a row to this table. |
void |
addRows(int nrows)
Add a given number of rows to this table. |
void |
addTableListener(TableListener listnr)
Add a table listener to this table. |
Tuple |
addTuple(Tuple t)
Add a Tuple to this table. |
boolean |
canGet(java.lang.String field,
java.lang.Class type)
Check if the get method for the given data field returns
values that are compatible with a given target type. |
boolean |
canGetBoolean(java.lang.String field)
Check if the given data field can return primitive boolean
values. |
boolean |
canGetDate(java.lang.String field)
Check if the given data field can return primitive Date
values. |
boolean |
canGetDouble(java.lang.String field)
Check if the given data field can return primitive double
values. |
boolean |
canGetFloat(java.lang.String field)
Check if the given data field can return primitive float
values. |
boolean |
canGetInt(java.lang.String field)
Check if the given data field can return primitive int
values. |
boolean |
canGetLong(java.lang.String field)
Check if the given data field can return primitive long
values. |
boolean |
canGetString(java.lang.String field)
Check if the given data field can return primitive String
values. |
boolean |
canSet(java.lang.String field,
java.lang.Class type)
Check if the set method for the given data field can
accept values of a given target type. |
boolean |
canSetBoolean(java.lang.String field)
Check if the setBoolean method can safely be used for the
given data field. |
boolean |
canSetDate(java.lang.String field)
Check if the setDate method can safely be used for the
given data field. |
boolean |
canSetDouble(java.lang.String field)
Check if the setDouble method can safely be used for the
given data field. |
boolean |
canSetFloat(java.lang.String field)
Check if the setFloat method can safely be used for the
given data field. |
boolean |
canSetInt(java.lang.String field)
Check if the setInt method can safely be used for the
given data field. |
boolean |
canSetLong(java.lang.String field)
Check if the setLong method can safely be used for the
given data field. |
boolean |
canSetString(java.lang.String field)
Check if the setString method can safely be used for the
given data field. |
void |
clear()
Clear this table, removing all rows. |
void |
columnChanged(Column src,
int idx,
boolean prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
double prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
float prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
int prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int type,
int start,
int end)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
long prev)
Notification that a data column has changed. |
void |
columnChanged(Column src,
int idx,
java.lang.Object prev)
Notification that a data column has changed. |
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. |
java.lang.Object |
get(int row,
int col)
Get the data value at the given row and column numbers as an Object. |
java.lang.Object |
get(int row,
java.lang.String field)
Get the data value at the given row and field as an Object. |
boolean |
getBoolean(int row,
int col)
Get the data value at the given row and field as a boolean . |
boolean |
getBoolean(int row,
java.lang.String field)
Get the data value at the given row and field as a boolean . |
Column |
getColumn(int col)
Get the column at the given column number. |
Column |
getColumn(java.lang.String field)
Get the column with the given data field name |
int |
getColumnCount()
Get the number of columns / data fields in this table. |
java.lang.String |
getColumnName(int col)
Get the data field name of the column at the given column number. |
protected java.util.Iterator |
getColumnNames()
Internal method that returns an iterator over column names |
int |
getColumnNumber(Column col)
Get the column number for the given Column instance. |
int |
getColumnNumber(java.lang.String field)
Get the column number for a given data field name. |
int |
getColumnRow(int row,
int col)
Get the row value for accessing an underlying Column instance, corresponding to the given table cell. |
protected java.util.Iterator |
getColumns()
Internal method that returns an iterator over columns |
java.lang.Class |
getColumnType(int col)
Get the data type of the column at the given column index. |
java.lang.Class |
getColumnType(java.lang.String field)
Get the data type of the column with the given data field name. |
java.util.Date |
getDate(int row,
int col)
Get the data value at the given row and field as a Date . |
java.util.Date |
getDate(int row,
java.lang.String field)
Get the data value at the given row and field as a Date . |
java.lang.Object |
getDefault(java.lang.String field)
Get the default value for the given data field. |
double |
getDouble(int row,
int col)
Get the data value at the given row and field as a double . |
double |
getDouble(int row,
java.lang.String field)
Get the data value at the given row and field as a double . |
float |
getFloat(int row,
int col)
Get the data value at the given row and field as a float . |
float |
getFloat(int row,
java.lang.String field)
Get the data value at the given row and field as a float . |
Index |
getIndex(java.lang.String field)
Retrieve, without creating, an index for the given data field. |
protected Index |
getIndex(java.lang.String field,
java.lang.Class expType,
boolean create)
Internal method for index creation and retrieval. |
int |
getInt(int row,
int col)
Get the data value at the given row and field as an int . |
int |
getInt(int row,
java.lang.String field)
Get the data value at the given row and field as an int . |
long |
getLong(int row,
int col)
Get the data value at the given row and field as an long . |
long |
getLong(int row,
java.lang.String field)
Get the data value at the given row and field as a long . |
int |
getMaximumRow()
Get the maximum row index currently in use by this Table. |
ColumnMetadata |
getMetadata(java.lang.String field)
Return a metadata instance providing summary information about a column. |
int |
getMinimumRow()
Get the minimum row index currently in use by this Table. |
int |
getModificationCount()
Get the number of times this Table has been modified. |
int |
getRowCount()
Get the number of rows in the table. |
Schema |
getSchema()
Returns this Table's schema. |
java.lang.String |
getString(int row,
int col)
Get the data value at the given row and field as a String . |
java.lang.String |
getString(int row,
java.lang.String field)
Get the data value at the given row and field as a String . |
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. |
Tuple |
getTuple(int row)
Get the Tuple instance providing object-oriented access to the given table row. |
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(java.lang.String name)
Internal method indicating if the given data field is included as a data column. |
Index |
index(java.lang.String field)
Create (if necessary) and return an index over the given data field. |
protected void |
invalidateSchema()
Invalidates this table's cached schema. |
boolean |
isAddColumnSupported()
Returns true, as this table supports the addition of new data fields. |
boolean |
isCellEditable(int row,
int col)
Indicates if the value of the given table cell can be changed. |
boolean |
isValidRow(int row)
Indicates if the given row number corresponds to a valid table row. |
TableIterator |
iterator()
Return a TableIterator over the rows of this table. |
TableIterator |
iterator(IntIterator rows)
Return a TableIterator over the given rows of this table. |
IntIterator |
rangeSortedBy(java.lang.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. |
IntIterator |
rangeSortedBy(java.lang.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. |
IntIterator |
rangeSortedBy(java.lang.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. |
IntIterator |
rangeSortedBy(java.lang.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. |
IntIterator |
rangeSortedBy(java.lang.String field,
java.lang.Object lo,
java.lang.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. |
void |
remove(Predicate filter)
Removes all table rows that meet the input predicate filter. |
void |
removeAllTableListeners()
Removes all table listeners from this table. |
void |
removeColumn(Column c)
Remove a column from this table |
protected Column |
removeColumn(int idx)
Internal method for removing a column. |
Column |
removeColumn(java.lang.String field)
Remove a data field from this table |
boolean |
removeIndex(java.lang.String field)
Remove the Index associated with the given data field / column name. |
boolean |
removeRow(int row)
Removes a row from this table. |
void |
removeTableListener(TableListener listnr)
Remove a table listener from this table. |
boolean |
removeTuple(Tuple t)
Remove a tuple from this table. |
protected void |
renumberColumns()
Internal method that re-numbers columns upon column removal. |
void |
revertToDefault(int row,
java.lang.String field)
Revert this tuple's value for the given field to the default value for the field. |
IntIterator |
rows()
Get an interator over the row numbers of this table. |
IntIterator |
rows(boolean reverse)
Get an interator over the row numbers of this table. |
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. |
IntIterator |
rowsSortedBy(java.lang.String field,
boolean ascend)
Get an iterator over the rows of this table, sorted by the given data field. |
Table |
select(Predicate filter,
Sort sort)
Query this table for a filtered, sorted subset of this table. |
void |
set(int row,
int col,
java.lang.Object val)
Set the value of at the given row and column numbers. |
void |
set(int row,
java.lang.String field,
java.lang.Object val)
Set the value of a given row and data field. |
void |
setBoolean(int row,
int col,
boolean val)
Set the data value of the given row and field as a boolean . |
void |
setBoolean(int row,
java.lang.String field,
boolean val)
Set the data value of the given row and field as a boolean . |
void |
setDate(int row,
int col,
java.util.Date val)
Set the data value of the given row and field as a Date . |
void |
setDate(int row,
java.lang.String field,
java.util.Date val)
Set the data value of the given row and field as a Date . |
void |
setDouble(int row,
int col,
double val)
Set the data value of the given row and field as a double . |
void |
setDouble(int row,
java.lang.String field,
double val)
Set the data value of the given row and field as a double . |
void |
setFloat(int row,
int col,
float val)
Set the data value of the given row and field as a float . |
void |
setFloat(int row,
java.lang.String field,
float val)
Set the data value of the given row and field as a float . |
void |
setInt(int row,
int col,
int val)
Set the data value of the given row and field as an int . |
void |
setInt(int row,
java.lang.String field,
int val)
Set the data value of the given row and field as an int . |
void |
setLong(int row,
int col,
long val)
Set the data value of the given row and field as an long . |
void |
setLong(int row,
java.lang.String field,
long val)
Set the data value of the given row and field as a long . |
void |
setString(int row,
int col,
java.lang.String val)
Set the data value of the given row and field as a String . |
void |
setString(int row,
java.lang.String field,
java.lang.String val)
Set the data value of the given row and field as a String . |
Tuple |
setTuple(Tuple t)
Clears the contents of this table and then attempts to add the given Tuple instance. |
void |
setTupleManager(TupleManager tm)
Sets the TupleManager used by this Table. |
java.lang.String |
toString()
|
java.util.Iterator |
tuples()
Get an iterator over the tuples in this table. |
java.util.Iterator |
tuples(IntIterator rows)
Get an iterator over the tuples for the given rows in this table. |
java.util.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. |
Methods inherited from class prefuse.data.tuple.AbstractTupleSet |
---|
addColumns, addPropertyChangeListener, addPropertyChangeListener, addTupleSetListener, fireTupleEvent, fireTupleEvent, fireTupleEvent, getClientProperty, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTupleSetListener, tuples, tuples |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected CopyOnWriteArrayList m_listeners
protected java.util.ArrayList m_columns
protected java.util.ArrayList m_names
protected java.util.HashMap m_entries
protected RowManager m_rows
protected TupleManager m_tuples
protected int m_modCount
protected int m_lastCol
protected Schema m_schema
Constructor Detail |
---|
public Table()
addRow()
method.
public Table(int nrows, int ncols)
nrows
- the starting number of table rowsncols
- the starting capacity for columnsprotected Table(int nrows, int ncols, java.lang.Class tupleType)
nrows
- the starting number of table rowsncols
- the starting capacity for columnstupleType
- the class of the Tuple instances to useMethod Detail |
---|
public int getColumnCount()
public java.lang.Class getColumnType(int col)
col
- the column index
public java.lang.Class getColumnType(java.lang.String field)
field
- the column / data field name
public int getRowCount()
public int getMinimumRow()
public int getMaximumRow()
public boolean isCellEditable(int row, int col)
row
- the row numbercol
- the column number
public int getModificationCount()
public void setTupleManager(TupleManager tm)
tm
- the TupleManager to usepublic Schema getSchema()
protected void invalidateSchema()
public int getColumnRow(int row, int col)
getTableRow(int, int)
accesses this map in the reverse
direction.
row
- the table row to lookupcol
- the table column to lookup
public int getTableRow(int colrow, int col)
getColumnRow(int, int)
accesses this map in the reverse
direction.
colrow
- the row of the backing data columncol
- the table column to lookup.
public int addRow()
public void addRows(int nrows)
nrows
- the number of rows to add.protected void updateRowCount()
public boolean removeRow(int row)
row
- the row to delete
public void clear()
clear
in interface TupleSet
TupleSet.clear()
public boolean isValidRow(int row)
row
- the row number to check for validity
protected boolean hasColumn(java.lang.String name)
public java.lang.String getColumnName(int col)
col
- the column number
public int getColumnNumber(java.lang.String field)
field
- the name of the column to lookup
public int getColumnNumber(Column col)
col
- the Column instance to lookup
public Column getColumn(int col)
col
- the column number
public Column getColumn(java.lang.String field)
field
- the data field name of the column
public void addColumn(java.lang.String name, java.lang.Class type)
addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the data field name for the columntype
- the data type, as a Java Class, for the columnTupleSet.addColumn(java.lang.String, java.lang.Class)
public void addColumn(java.lang.String name, java.lang.Class type, java.lang.Object defaultValue)
addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the data field name for the columntype
- the data type, as a Java Class, for the columndefaultValue
- the default value for column data valuesTupleSet.addColumn(java.lang.String, java.lang.Class, java.lang.Object)
public void addColumn(java.lang.String name, java.lang.String expr)
addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the data field name for the columnexpr
- a String expression in the prefuse expression language, to
be parsed into an Expression
instance.
The string is parsed by the
ExpressionParser
. If an error
occurs during parsing, an exception will be thrown.TupleSet.addColumn(java.lang.String, java.lang.String)
public void addColumn(java.lang.String name, Expression expr)
addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the data field name for the columnexpr
- the Expression that will determine the column valuesTupleSet.addColumn(java.lang.String, prefuse.data.expression.Expression)
public void addConstantColumn(java.lang.String name, java.lang.Class type, java.lang.Object dflt)
name
- the data field name for the columntype
- the data type, as a Java Class, for the columndflt
- the default value for column data valuesprotected void addColumn(java.lang.String name, Column col)
name
- the name of the columncol
- the actual Column instanceprotected Column removeColumn(int idx)
idx
- the column number of the column to remove
public Column removeColumn(java.lang.String field)
field
- the name of the data field / column to remove
public void removeColumn(Column c)
c
- the column instance to removeprotected void renumberColumns()
protected java.util.Iterator getColumns()
protected java.util.Iterator getColumnNames()
public ColumnMetadata getMetadata(java.lang.String field)
field
- the data field name of the column
public Index index(java.lang.String field)
getIndex(String)
method.
field
- the data field name of the column to index
public Index getIndex(java.lang.String field)
field
- the data field name of the column
protected Index getIndex(java.lang.String field, java.lang.Class expType, boolean create)
field
- the data field name of the columnexpType
- the expected data type of the indexcreate
- indicates whether or not a new index should be created
if none currently exists for the given data field
public boolean removeIndex(java.lang.String field)
field
- the name of the column for which to remove the index
public Tuple getTuple(int row)
row
- the table row
public Tuple addTuple(Tuple t)
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.
addTuple
in interface TupleSet
t
- the Tuple to "add" to this table
TupleSet.addTuple(prefuse.data.Tuple)
public Tuple setTuple(Tuple t)
setTuple
in interface TupleSet
t
- the Tuple to make the sole tuple in thie table
TupleSet.setTuple(prefuse.data.Tuple)
public boolean removeTuple(Tuple t)
removeTuple
in interface TupleSet
t
- the Tuple to remove from the table
TupleSet.removeTuple(prefuse.data.Tuple)
public boolean containsTuple(Tuple t)
containsTuple
in interface TupleSet
t
- the Tuple to check for containment
TupleSet.containsTuple(prefuse.data.Tuple)
public int getTupleCount()
getRowCount()
.
getTupleCount
in interface TupleSet
TupleSet.getTupleCount()
public boolean isAddColumnSupported()
isAddColumnSupported
in interface TupleSet
isAddColumnSupported
in class AbstractTupleSet
TupleSet.isAddColumnSupported()
public boolean canGet(java.lang.String field, java.lang.Class type)
get
method for the given data field returns
values that are compatible with a given target type.
field
- the data field to checktype
- a Class instance to check for compatibility with the
data field values.
get(int, String)
can be cast to the given type.get(int, String)
public boolean canSet(java.lang.String field, java.lang.Class type)
set
method for the given data field can
accept values of a given target type.
field
- the data field to checktype
- a Class instance to check for compatibility with the
data field values.
set(int, String, Object)
method.set(int, String, Object)
public java.lang.Object get(int row, java.lang.String field)
row
- the table row to getfield
- the data field to retrieve
canGet(String, Class)
,
getColumnType(String)
public void set(int row, java.lang.String field, java.lang.Object val)
row
- the table row to setfield
- the data field to setval
- the value for the field. If the concrete type of this
Object is not compatible with the underlying data model, an
Exception will be thrown. Use the canSet(String, Class)
method to check the type-safety ahead of time.canSet(String, Class)
,
getColumnType(String)
public java.lang.Object get(int row, int col)
row
- the row numbercol
- the column number
canGet(String, Class)
,
getColumnType(int)
public void set(int row, int col, java.lang.Object val)
row
- the row numbercol
- the column numberval
- the value for the field. If the concrete type of this
Object is not compatible with the underlying data model, an
Exception will be thrown. Use the canSet(String, Class)
method to check the type-safety ahead of time.canSet(String, Class)
,
getColumnType(String)
public java.lang.Object getDefault(java.lang.String field)
field
- the data field
public void revertToDefault(int row, java.lang.String field)
field
- the data fieldgetDefault(String)
public final boolean canGetInt(java.lang.String field)
int
values.
field
- the data field to check
int
values, false otherwise. If true, the getInt(int, String)
method can be used safely.public final boolean canSetInt(java.lang.String field)
setInt
method can safely be used for the
given data field.
field
- the data field to check
setInt(int, String, int)
method can safely
be used for the given field, false otherwise.public final int getInt(int row, java.lang.String field)
int
.
row
- the table row to retrievefield
- the data field to retrievecanGetInt(String)
public final void setInt(int row, java.lang.String field, int val)
int
.
row
- the table row to setfield
- the data field to setval
- the value to setcanSetInt(String)
public final int getInt(int row, int col)
int
.
row
- the table row to retrievecol
- the column number of the data field to retrievecanGetInt(String)
public final void setInt(int row, int col, int val)
int
.
row
- the table row to setcol
- the column number of the data field to setval
- the value to setcanSetInt(String)
public final boolean canGetLong(java.lang.String field)
long
values.
field
- the data field to check
long
values, false otherwise. If true, the getLong(int, String)
method can be used safely.public final boolean canSetLong(java.lang.String field)
setLong
method can safely be used for the
given data field.
field
- the data field to check
setLong(int, String, long)
method can
safely be used for the given field, false otherwise.public final long getLong(int row, java.lang.String field)
long
.
row
- the table row to retrievefield
- the data field to retrievecanGetLong(String)
public final void setLong(int row, java.lang.String field, long val)
long
.
row
- the table row to setfield
- the data field to setval
- the value to setcanSetLong(String)
public final long getLong(int row, int col)
long
.
row
- the table row to retrievecol
- the column number of the data field to retrievecanGetLong(String)
public final void setLong(int row, int col, long val)
long
.
row
- the table row to setcol
- the column number of the data field to setval
- the value to setcanSetLong(String)
public final boolean canGetFloat(java.lang.String field)
float
values.
field
- the data field to check
float
values, false otherwise. If true, the getFloat(int, String)
method can be used safely.public final boolean canSetFloat(java.lang.String field)
setFloat
method can safely be used for the
given data field.
field
- the data field to check
setFloat(int, String, float)
method can
safely be used for the given field, false otherwise.public final float getFloat(int row, java.lang.String field)
float
.
row
- the table row to retrievefield
- the data field to retrievecanGetFloat(String)
public final void setFloat(int row, java.lang.String field, float val)
float
.
row
- the table row to setfield
- the data field to setval
- the value to setcanSetFloat(String)
public final float getFloat(int row, int col)
float
.
row
- the table row to retrievecol
- the column number of the data field to getcanGetFloat(String)
public final void setFloat(int row, int col, float val)
float
.
row
- the table row to setcol
- the column number of the data field to setval
- the value to setcanSetFloat(String)
public final boolean canGetDouble(java.lang.String field)
double
values.
field
- the data field to check
double
values, false otherwise. If true, the getDouble(int, String)
method can be used safely.public final boolean canSetDouble(java.lang.String field)
setDouble
method can safely be used for the
given data field.
field
- the data field to check
setDouble(int, String, double)
method can
safely be used for the given field, false otherwise.public final double getDouble(int row, java.lang.String field)
double
.
row
- the table row to retrievefield
- the data field to retrievecanGetDouble(String)
public final void setDouble(int row, java.lang.String field, double val)
double
.
row
- the table row to setfield
- the data field to setval
- the value to setcanSetDouble(String)
public final double getDouble(int row, int col)
double
.
row
- the table row to retrievecol
- the column number of the data field to getcanGetDouble(String)
public final void setDouble(int row, int col, double val)
double
.
row
- the table row to setcol
- the column number of the data field to setval
- the value to setcanSetDouble(String)
public final boolean canGetBoolean(java.lang.String field)
boolean
values.
field
- the data field to check
boolean
values, false otherwise. If true, the getBoolean(int, String)
method can be used safely.public final boolean canSetBoolean(java.lang.String field)
setBoolean
method can safely be used for the
given data field.
field
- the data field to check
setBoolean(int, String, boolean)
method can
safely be used for the given field, false otherwise.public final boolean getBoolean(int row, java.lang.String field)
boolean
.
row
- the table row to retrievefield
- the data field to retrievecanGetBoolean(String)
public final void setBoolean(int row, java.lang.String field, boolean val)
boolean
.
row
- the table row to setfield
- the data field to setval
- the value to setcanSetBoolean(String)
public final boolean getBoolean(int row, int col)
boolean
.
row
- the table row to retrievecol
- the column number of the data field to getcanGetBoolean(String)
public final void setBoolean(int row, int col, boolean val)
boolean
.
row
- the table row to setcol
- the column number of the data field to setval
- the value to setcanSetBoolean(String)
public final boolean canGetString(java.lang.String field)
String
values.
field
- the data field to check
String
values, false otherwise. If true, the getString(int, String)
method can be used safely.public final boolean canSetString(java.lang.String field)
setString
method can safely be used for the
given data field.
field
- the data field to check
setString(int, String, String)
method can
safely be used for the given field, false otherwise.public final java.lang.String getString(int row, java.lang.String field)
String
.
row
- the table row to retrievefield
- the data field to retrievecanGetString(String)
public final void setString(int row, java.lang.String field, java.lang.String val)
String
.
row
- the table row to setfield
- the data field to setval
- the value to setcanSetString(String)
public final java.lang.String getString(int row, int col)
String
.
row
- the table row to retrievecol
- the column number of the data field to retrievecanGetString(String)
public final void setString(int row, int col, java.lang.String val)
String
.
row
- the table row to setcol
- the column number of the data field to setval
- the value to setcanSetString(String)
public final boolean canGetDate(java.lang.String field)
Date
values.
field
- the data field to check
Date
values, false otherwise. If true, the getDate(int, String)
method can be used safely.public final boolean canSetDate(java.lang.String field)
setDate
method can safely be used for the
given data field.
field
- the data field to check
setDate(int, String, Date)
method can
safely be used for the given field, false otherwise.public final java.util.Date getDate(int row, java.lang.String field)
Date
.
row
- the table row to retrievefield
- the data field to retrievecanGetDate(String)
public final void setDate(int row, java.lang.String field, java.util.Date val)
Date
.
row
- the table row to setfield
- the data field to setval
- the value to setcanSetDate(String)
public final java.util.Date getDate(int row, int col)
Date
.
row
- the table row to retrievecol
- the column number of the data field to retrievecanGetDate(String)
public final void setDate(int row, int col, java.util.Date val)
Date
.
row
- the table row to setcol
- the column number of the data field to setval
- the value to setcanSetDate(String)
public Table select(Predicate filter, Sort sort)
CascadedTable
class.
filter
- the predicate filter determining which rows to include
in the new table. If this value is null, all rows will be included.sort
- the sorting criteria determining the order in which
rows are added to the new table. If this value is null, the rows
will not be sorted.
public void remove(Predicate filter)
filter
- a predicate specifying which rows to remove from
the table.public TableIterator iterator()
public TableIterator iterator(IntIterator rows)
rows
- an iterator over the table rows to visit
public java.util.Iterator tuples()
tuples
in interface TupleSet
TupleSet.tuples()
public java.util.Iterator tuplesReversed()
public java.util.Iterator tuples(IntIterator rows)
rows
- an iterator over the table rows to visit
public IntIterator rows()
public IntIterator rows(Predicate filter)
filter
- the filter predicate to apply
public IntIterator rows(boolean reverse)
reverse
- true to iterate in rever order, false for normal order
public IntIterator rowsSortedBy(java.lang.String field, boolean ascend)
field
- the data field to sort byascend
- true if the iteration should proceed in an ascending
(lowest to highest) sort order, false for a descending order
public IntIterator rangeSortedBy(java.lang.String field, int lo, int hi, int indexType)
field
- the data field for determining the bounded rangelo
- the minimum range valuehi
- the maximum range valueindexType
- indicate the sort order and inclusivity/exclusivity
of the range bounds, using the constants of the
Index
class.
public IntIterator rangeSortedBy(java.lang.String field, long lo, long hi, int indexType)
field
- the data field for determining the bounded rangelo
- the minimum range valuehi
- the maximum range valueindexType
- indicate the sort order and inclusivity/exclusivity
of the range bounds, using the constants of the
Index
class.
public IntIterator rangeSortedBy(java.lang.String field, float lo, float hi, int indexType)
field
- the data field for determining the bounded rangelo
- the minimum range valuehi
- the maximum range valueindexType
- indicate the sort order and inclusivity/exclusivity
of the range bounds, using the constants of the
Index
class.
public IntIterator rangeSortedBy(java.lang.String field, double lo, double hi, int indexType)
field
- the data field for determining the bounded rangelo
- the minimum range valuehi
- the maximum range valueindexType
- indicate the sort order and inclusivity/exclusivity
of the range bounds, using the constants of the
Index
class.
public IntIterator rangeSortedBy(java.lang.String field, java.lang.Object lo, java.lang.Object hi, int indexType)
field
- the data field for determining the bounded rangelo
- the minimum range valuehi
- the maximum range valueindexType
- indicate the sort order and inclusivity/exclusivity
of the range bounds, using the constants of the
Index
class.
public void columnChanged(Column src, int idx, boolean prev)
ColumnListener
columnChanged
in interface ColumnListener
src
- the column that has changedidx
- the column row index that has changedprev
- the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, boolean)
public void columnChanged(Column src, int idx, double prev)
ColumnListener
columnChanged
in interface ColumnListener
src
- the column that has changedidx
- the column row index that has changedprev
- the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, double)
public void columnChanged(Column src, int idx, float prev)
ColumnListener
columnChanged
in interface ColumnListener
src
- the column that has changedidx
- the column row index that has changedprev
- the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, float)
public void columnChanged(Column src, int idx, int prev)
ColumnListener
columnChanged
in interface ColumnListener
src
- the column that has changedidx
- the column row index that has changedprev
- the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, int)
public void columnChanged(Column src, int idx, long prev)
ColumnListener
columnChanged
in interface ColumnListener
src
- the column that has changedidx
- the column row index that has changedprev
- the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, long)
public void columnChanged(Column src, int idx, java.lang.Object prev)
ColumnListener
columnChanged
in interface ColumnListener
src
- the column that has changedidx
- the column row index that has changedprev
- the previous value at the given locationColumnListener.columnChanged(prefuse.data.column.Column, int, java.lang.Object)
public void columnChanged(Column src, int type, int start, int end)
ColumnListener
columnChanged
in interface ColumnListener
src
- the column that has changedtype
- One of EventConstants.INSERT
,
EventConstants.DELETE
, or EventConstants.UPDATE
.start
- the first column index that has been changedend
- the last column index that has been changedColumnListener.columnChanged(prefuse.data.column.Column, int, int, int)
protected void handleColumnChanged(Column c, int start, int end)
c
- the modified columnstart
- the starting row of the modified rangeend
- the ending row (inclusive) of the modified rangepublic void addTableListener(TableListener listnr)
listnr
- the listener to addpublic void removeTableListener(TableListener listnr)
listnr
- the listener to removepublic void removeAllTableListeners()
protected void fireTableEvent(int row0, int row1, int col, int type)
row0
- the starting row of the modified rangerow1
- the ending row (inclusive) of the modified rangecol
- the number of the column modified, or
EventConstants.ALL_COLUMNS
for operations
effecting all columns.type
- the table modification type, one of
EventConstants.INSERT
,
EventConstants.DELETE
, or
EventConstants.UPDATE
.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |