|
||||||||||
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 prefuse.data.CascadedTable
public class CascadedTable
Table subclass featuring a "cascaded" table design - a CascadedTable can have a parent table, from which it inherits a potentially filtered set of rows and columns. Child tables may override the columns of the parent by having a column of the same name as that of the parent, in which case the parent's column will not be accessible.
Table rows of the parent table can be selectively included by providing
a Predicate
that filters the parent rows.
Columns of the parent table can be selectively included by providing
a ColumnProjection
indicating the columns to
include.
Tuple instances backed by a CascadedTable will be not be equivalent to the tuples backed by the parent table. However, setting a value in a CascadedTable that is inherited from a parent table will update the value in the parent table.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class prefuse.data.Table |
---|
Table.ColumnEntry |
Field Summary | |
---|---|
protected ColumnProjection |
m_colFilter
ColumnProjection determining which columns of the parent table are included in this table. |
protected prefuse.data.CascadedTable.Listener |
m_listener
An internal listener class |
protected Table |
m_parent
Cascaded parent table |
protected java.util.ArrayList |
m_pnames
List of included parent column names |
protected Predicate |
m_rowFilter
Selection Predicate determining which rows of the parent table are included in this table. |
Fields inherited from class prefuse.data.Table |
---|
m_columns, m_entries, m_lastCol, m_listeners, m_modCount, m_names, m_rows, m_schema, m_tuples |
Fields inherited from interface prefuse.data.tuple.TupleSet |
---|
EMPTY_ARRAY |
Constructor Summary | |
---|---|
protected |
CascadedTable()
Create a CascadedTable without a backing parent table. |
protected |
CascadedTable(java.lang.Class tupleType)
Create a CascadedTable without a backing parent table. |
|
CascadedTable(Table parent)
Create a new CascadedTable. |
|
CascadedTable(Table parent,
ColumnProjection colFilter)
Create a new CascadedTable. |
|
CascadedTable(Table parent,
Predicate rowFilter)
Create a new CascadedTable. |
|
CascadedTable(Table parent,
Predicate rowFilter,
ColumnProjection colFilter)
Create a new CascadedTable. |
protected |
CascadedTable(Table parent,
Predicate rowFilter,
ColumnProjection colFilter,
java.lang.Class tupleType)
Create a new CascadedTable. |
Method Summary | |
---|---|
protected int |
addCascadedRow(int prow)
Internal method for adding a new cascaded row backed by the given parent row. |
int |
addRow()
Add a row to this table. |
void |
addRows(int nrows)
Add a given number of rows to this table. |
protected void |
filterColumns()
Determines which columns are inherited from the backing parent table. |
void |
filterRows()
Manually trigger a re-filtering of the rows of this table. |
int |
getChildRow(int prow)
Given a row in the parent table, return the corresponding row, if any, in this table. |
Column |
getColumn(int col)
Get the column at the given column number. |
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. |
ColumnProjection |
getColumnProjection()
Get the ColumnProjection determining which columns of the parent table are included in this one. |
int |
getLocalColumnCount()
Get the number of columns explicitly stored by this table (i.e., all columns that are not inherited from the parent table). |
int |
getParentRow(int row)
Given a row in this table, return the corresponding row in the parent table. |
Table |
getParentTable()
Get the parent table from which this cascaded table inherits values. |
Predicate |
getRowFilter()
Gets ths Predicate determining which rows of the parent table are included in this one. |
protected boolean |
hasColumn(java.lang.String name)
Internal method indicating if the given data field is included as a data column. |
protected void |
invalidateSchema()
Invalidates this table's cached schema. |
protected boolean |
removeCascadedRow(int row)
Internal method for removing a cascaded row from this table. |
boolean |
removeRow(int row)
Removes a row from this table. |
void |
setColumnProjection(ColumnProjection colFilter)
Sets the ColumnProjection determining which columns of the parent table are included in this one. |
void |
setRowFilter(Predicate rowFilter)
Sets the Predicate determining which rows of the parent table are included in this one. |
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 Table m_parent
protected java.util.ArrayList m_pnames
protected ColumnProjection m_colFilter
protected Predicate m_rowFilter
protected prefuse.data.CascadedTable.Listener m_listener
Constructor Detail |
---|
public CascadedTable(Table parent)
parent
- the parent Table to usepublic CascadedTable(Table parent, Predicate rowFilter)
parent
- the parent Table to userowFilter
- a Predicate determining which rows of the parent
table to include in this one.public CascadedTable(Table parent, ColumnProjection colFilter)
parent
- the parent Table to usecolFilter
- a ColumnProjection determining which columns of the
parent table to include in this one.public CascadedTable(Table parent, Predicate rowFilter, ColumnProjection colFilter)
parent
- the parent Table to userowFilter
- a Predicate determining which rows of the parent
table to include in this one.colFilter
- a ColumnProjection determining which columns of the
parent table to include in this one.protected CascadedTable(Table parent, Predicate rowFilter, ColumnProjection colFilter, java.lang.Class tupleType)
parent
- the parent Table to userowFilter
- a Predicate determining which rows of the parent
table to include in this one.colFilter
- a ColumnProjection determining which columns of the
parent table to include in this one.tupleType
- the class type of the Tuple instances to useprotected CascadedTable()
protected CascadedTable(java.lang.Class tupleType)
tupleType
- the class type of the Tuple instances to useMethod Detail |
---|
protected void filterColumns()
public void filterRows()
ValidEdgePredicate
public ColumnProjection getColumnProjection()
public void setColumnProjection(ColumnProjection colFilter)
colFilter
- a ColumnProjection determining which columns of the
parent table to include in this one.public Predicate getRowFilter()
public void setRowFilter(Predicate rowFilter)
rowFilter
- a Predicate determining which rows of the parent
table to include in this one.public int getColumnCount()
Table
getColumnCount
in class Table
Table.getColumnCount()
public int getLocalColumnCount()
public Table getParentTable()
public int getParentRow(int row)
row
- a row in this table
public int getChildRow(int prow)
prow
- a row in the parent table
public int addRow()
Table
addRow
in class Table
Table.addRow()
public void addRows(int nrows)
Table
addRows
in class Table
nrows
- the number of rows to add.Table.addRows(int)
public boolean removeRow(int row)
Table
removeRow
in class Table
row
- the row to delete
Table.removeRow(int)
protected int addCascadedRow(int prow)
prow
- the parent row to inherit
protected boolean removeCascadedRow(int row)
row
- the row to remove
public java.lang.String getColumnName(int col)
Table
getColumnName
in class Table
col
- the column number
Table.getColumnName(int)
public int getColumnNumber(Column col)
Table
getColumnNumber
in class Table
col
- the Column instance to lookup
Table.getColumnNumber(prefuse.data.column.Column)
public Column getColumn(int col)
Table
getColumn
in class Table
col
- the column number
Table.getColumn(int)
protected boolean hasColumn(java.lang.String name)
Table
hasColumn
in class Table
Table.hasColumn(java.lang.String)
protected java.util.Iterator getColumnNames()
Table
getColumnNames
in class Table
Table.getColumnNames()
protected void invalidateSchema()
invalidateSchema
in class Table
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |