prefuse.data.util
Class FilteredRowManager

java.lang.Object
  extended by prefuse.data.util.RowManager
      extended by prefuse.data.util.FilteredRowManager
Direct Known Subclasses:
CascadedRowManager

public class FilteredRowManager
extends RowManager

RowManager that additionally manages mappings between the managed rows and those of a parent table.

Author:
jeffrey heer

Nested Class Summary
 
Nested classes/interfaces inherited from class prefuse.data.util.RowManager
RowManager.ColumnRowIterator, RowManager.RowIterator
 
Field Summary
protected  IntColumn m_childToParent
           
protected  IntIntSortedMap m_parentToChild
           
 
Fields inherited from class prefuse.data.util.RowManager
m_table
 
Constructor Summary
FilteredRowManager(Table table)
          Create a new FilteredRowManager.
 
Method Summary
 int addRow(int parentRow)
          Add a new row backed by the given parent row.
 void clear()
          Clear the row manager status, marking all rows as available.
 int getChildRow(int parentRow)
          Given a row in the parent table, return the corresponding row managed by this manager.
 int getColumnRow(int row, int col)
          Given Table row and column indices, return the corresponding row in the underlying data column.
 int getParentRow(int childRow)
          Given a row managed by this manager, return the corresponding row in the parent table.
 int getTableRow(int columnRow, int col)
          Given a column row index and a table column index, return the table row corresponding to the column value.
 void put(int childRow, int parentRow)
          Add a mapping between the given managed row and parent row.
 boolean releaseRow(int row)
          Release a row and mark it as free.
 void remove(int childRow)
          Remove a mapping between the given managed row and the corresponding parent row.
 
Methods inherited from class prefuse.data.util.RowManager
addRow, columnRows, columnRows, columnRows, getMaximumRow, getMinimumRow, getRowCount, getTable, isValidRow, rows, rows
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_childToParent

protected IntColumn m_childToParent

m_parentToChild

protected IntIntSortedMap m_parentToChild
Constructor Detail

FilteredRowManager

public FilteredRowManager(Table table)
Create a new FilteredRowManager.

Parameters:
table - the table to manage
Method Detail

clear

public void clear()
Description copied from class: RowManager
Clear the row manager status, marking all rows as available.

Overrides:
clear in class RowManager
See Also:
RowManager.clear()

addRow

public int addRow(int parentRow)
Add a new row backed by the given parent row.

Parameters:
parentRow - the backing parent row
Returns:
the index of the newly added row

releaseRow

public boolean releaseRow(int row)
Description copied from class: RowManager
Release a row and mark it as free.

Overrides:
releaseRow in class RowManager
Parameters:
row - the row index of the released row
Returns:
true if the row was successfully released, false if it was already free or if the input is not a valid row index
See Also:
RowManager.releaseRow(int)

getColumnRow

public int getColumnRow(int row,
                        int col)
Description copied from class: RowManager
Given Table row and column indices, return the corresponding row in the underlying data column. This is of use for CascadedTable instances, which may reveal only a limited set of a parent table's rows and so must map between table rows and the actual indices of the inherited data columns.

Overrides:
getColumnRow in class RowManager
Parameters:
row - the table row
col - the table column
Returns:
the row value for accessing the correct value of the referenced data column.
See Also:
RowManager.getColumnRow(int, int)

getTableRow

public int getTableRow(int columnRow,
                       int col)
Description copied from class: RowManager
Given a column row index and a table column index, return the table row corresponding to the column value. This is of use for CascadedTable instances, which may reveal only a limited set of a parent table's rows and so must map between table rows and the actual indices of the inherited data columns.

Overrides:
getTableRow in class RowManager
Parameters:
columnRow - the row of the underlying data column
col - the table column
Returns:
the row value for the Table that corresponds to the given column row
See Also:
RowManager.getTableRow(int, int)

getParentRow

public int getParentRow(int childRow)
Given a row managed by this manager, return the corresponding row in the parent table.

Parameters:
childRow - a row managed by this manager
Returns:
the parent table row

getChildRow

public int getChildRow(int parentRow)
Given a row in the parent table, return the corresponding row managed by this manager.

Parameters:
parentRow - a row in the parent table
Returns:
the managed row corresponding to the parent row

put

public void put(int childRow,
                int parentRow)
Add a mapping between the given managed row and parent row.

Parameters:
childRow - a row managed by this manager
parentRow - a row in the parent table

remove

public void remove(int childRow)
Remove a mapping between the given managed row and the corresponding parent row.

Parameters:
childRow - a row managed by this manager


Copyright © 2007 Regents of the University of California