filters
Class TableParamsFilter
java.lang.Object
javax.swing.table.AbstractTableModel
tableoperations.TableMap
tableoperations.TableFilter
filters.TableParamsFilter
- All Implemented Interfaces:
- EventListener, Serializable, TableModel, TableModelListener
- public class TableParamsFilter
- extends TableFilter
A Filter for TableModels, given an array of parameters FilterParam. This
Filter listens to its parameters so as to be up to date at every time it is
needed. However calling reallocateIndexes may be used to refresh the contents
of the table. fireTableDataChanged alerts all the listeners that the table has
changed. Usually a call to reallocateIndexes should be followed by a call to
fireTableDataChanged.
- Author:
- Etienne Fort
- See Also:
FilterParam
,
Serialized Form
Fields inherited from class tableoperations.TableFilter |
|
Method Summary |
boolean |
filterFunction(int row)
Filters Double values, given a FilterParam. |
void |
reallocateIndexes()
Besides computing the mapping Arraylist, computes first the max
and min values in the filtered column. |
void |
setParams(FilterParam[] params)
Defines the params for the filtering operation. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
maxValues
private Double[] maxValues
minValues
private Double[] minValues
params
private FilterParam[] params
TableParamsFilter
public TableParamsFilter(TableModel model,
FilterParam[] params)
- Creates a new TableParamsFilter given the original table and a set of
params. The table registers itself as a listener to the params.
- Parameters:
model
- the original tableparams
- the set of params taken into account
filterFunction
public boolean filterFunction(int row)
- Filters Double values, given a FilterParam. Doubles are filtered
relatively to the original table max values and min values in the fixed
column.
- Specified by:
filterFunction
in class TableFilter
- Parameters:
row
- index of the row to check.
- Returns:
- false if the line must be ignored, true otherwise
- See Also:
TableFilter.filterFunction(int)
reallocateIndexes
public void reallocateIndexes()
- Besides computing the mapping Arraylist, computes first the max
and min values in the filtered column.
- Overrides:
reallocateIndexes
in class TableFilter
- See Also:
TableFilter.reallocateIndexes()
setParams
public void setParams(FilterParam[] params)
- Defines the params for the filtering operation.
- Parameters:
params
- The params to set.