infovis.table
Class FilteredTable

java.lang.Object
  extended by infovis.utils.ChangeManager
      extended by infovis.column.AbstractColumn
          extended by infovis.column.ColumnProxy
              extended by infovis.table.TableProxy
                  extended by infovis.table.FilteredTable
All Implemented Interfaces:
IntComparator, Column, ColumnFilter, Metadata, Constants, Table, RowComparator, Serializable, EventListener, ChangeListener, TableModelListener, TableModel

public class FilteredTable
extends TableProxy
implements ColumnFilter

Proxy Table filtering Columns.

Version:
$Revision: 1.13 $
Author:
Jean-Daniel Fekete
See Also:
Serialized Form

Field Summary
 
Fields inherited from class infovis.column.AbstractColumn
MODIFIED_ALL, MODIFIED_NONE
 
Fields inherited from interface infovis.Table
FILTER_COLUMN, INTERNAL_PREFIX, NIL, SELECTION_COLUMN
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
FilteredTable(Table table)
          Create a Filtered Table from a reference table.
FilteredTable(Table table, ColumnFilter filter)
          Create a Filtered Table from a reference table and a column filter.
FilteredTable(Table table, ColumnFilter filter, Comparator comp)
          Create a Filtered Table from a reference table, a column filter and a comparator that specifies the order of columns in the table.
 
Method Summary
 boolean filter(Column c)
          Returns true if the Column should be filtered out.
 Column getColumn(String name)
          Returns the column of a specified name.
 Column getColumnAt(int index)
          Returns the column at a specified index.
 int getColumnCount()
          Returns the number of columns of the table.
 Comparator getComparator()
          Returns the comparator.
 ColumnFilter getFilter()
          Returns the filter.
 int indexOf(Column column)
          Returns the index of a specified column.
 int indexOf(String name)
          Returns the index of a column of a specified name.
 void setComparator(Comparator comparator)
          Sets the comparator.
 void setFilter(ColumnFilter filter)
          Sets the filter.
 void sortColumns(Comparator comp)
          Sorts the column according the the specified Comparator.
 void stateChanged(ChangeEvent e)
          
 
Methods inherited from class infovis.table.TableProxy
addColumn, addTableModelListener, clear, getColumnClass, getColumnName, getLastRow, getRowCount, getTable, getValueAt, isCellEditable, isRowValid, removeColumn, removeTableModelListener, reverseIterator, setColumnAt, setValueAt, tableChanged
 
Methods inherited from class infovis.column.ColumnProxy
addValue, addValueOrNull, capacity, compare, dispose, ensureCapacity, getClientProperty, getFormat, getMaxIndex, getMetadata, getMinIndex, getName, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, iterator, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size
 
Methods inherited from class infovis.column.AbstractColumn
addChangeListener, compareValues, computeValueMap, computeValueMap, equalObj, equals, getLastModifiedRow, toString
 
Methods inherited from class infovis.utils.ChangeManager
disableNotify, enableNotify, getModCount, removeChangeListener
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface infovis.Column
addChangeListener, addValue, addValueOrNull, capacity, disableNotify, enableNotify, ensureCapacity, getFormat, getMaxIndex, getMinIndex, getName, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, iterator, removeChangeListener, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size
 
Methods inherited from interface infovis.Metadata
getClientProperty, getMetadata
 
Methods inherited from interface cern.colt.function.IntComparator
compare, equals
 

Constructor Detail

FilteredTable

public FilteredTable(Table table,
                     ColumnFilter filter,
                     Comparator comp)
Create a Filtered Table from a reference table, a column filter and a comparator that specifies the order of columns in the table.

Parameters:
table - the table
filter - the filter
comp - the comparator for the order of the columns.

FilteredTable

public FilteredTable(Table table,
                     ColumnFilter filter)
Create a Filtered Table from a reference table and a column filter.

Parameters:
table - the table
filter - the filter

FilteredTable

public FilteredTable(Table table)
Create a Filtered Table from a reference table.

Parameters:
table - the table
Method Detail

filter

public boolean filter(Column c)
Returns true if the Column should be filtered out.

Specified by:
filter in interface ColumnFilter
Parameters:
c - the column
Returns:
true if the Column should be filtered out.

getColumn

public Column getColumn(String name)
Description copied from class: TableProxy
Returns the column of a specified name.

Specified by:
getColumn in interface Table
Overrides:
getColumn in class TableProxy
Parameters:
name - the name.
Returns:
the column of a specified name.
See Also:
Table.getColumn(String)

getColumnCount

public int getColumnCount()
Description copied from class: TableProxy
Returns the number of columns of the table.

Specified by:
getColumnCount in interface Table
Specified by:
getColumnCount in interface TableModel
Overrides:
getColumnCount in class TableProxy
Returns:
the number of columns of the table.
See Also:
Table.getColumnCount()

sortColumns

public void sortColumns(Comparator comp)
Sorts the column according the the specified Comparator.

Parameters:
comp - the Comparator.

getColumnAt

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

Specified by:
getColumnAt in interface Table
Overrides:
getColumnAt in class TableProxy
Parameters:
index - the index.
Returns:
the column at a specified index or null if the index is out of range.

indexOf

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

Specified by:
indexOf in interface Table
Overrides:
indexOf in class TableProxy
Parameters:
name - the name.
Returns:
the index of a column of a specified name or -1 if no such column exist.

indexOf

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

Specified by:
indexOf in interface Table
Overrides:
indexOf in class TableProxy
Parameters:
column - the column
Returns:
the index of a specified column or -1 if the column is not in the table.

getComparator

public Comparator getComparator()
Returns the comparator.

Returns:
Comparator

getFilter

public ColumnFilter getFilter()
Returns the filter.

Returns:
ColumnFilter

setComparator

public void setComparator(Comparator comparator)
Sets the comparator.

Parameters:
comparator - The comparator to set

setFilter

public void setFilter(ColumnFilter filter)
Sets the filter.

Parameters:
filter - The filter to set

stateChanged

public void stateChanged(ChangeEvent e)

Specified by:
stateChanged in interface ChangeListener
Overrides:
stateChanged in class ColumnProxy


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