com.sciapp.filter
Class TableFilter

java.lang.Object
  extended by com.sciapp.filter.TableFilter
Direct Known Subclasses:
AndTableFilter, NotTableFilter, OrTableFilter

public class TableFilter
extends Object

TableFilter is used in order to filter the rows of a JTable.


Field Summary
static int ALL_COLUMNS
          Field specifying all columns of a table.
protected  int column
          The column of the table to filter
protected  Filter filter
          The filter being used.
 
Constructor Summary
TableFilter(Filter filter)
          Constructs a TableFilter object that will filter all columns of the table.
TableFilter(Filter filter, int column)
          Constructs a TableFilter object.
 
Method Summary
 boolean filter(ListTableModel model, Object row)
          Decides whether a particular row of a JTable will be filtered.
 int getColumn()
          Returns the column to filter.
 Filter getFilter()
          Returns the filter that will be used.
 void setColumn(int column)
          Sets the column to filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

protected Filter filter
The filter being used.


column

protected int column
The column of the table to filter


ALL_COLUMNS

public static final int ALL_COLUMNS
Field specifying all columns of a table.

See Also:
Constant Field Values
Constructor Detail

TableFilter

public TableFilter(Filter filter)
Constructs a TableFilter object that will filter all columns of the table.

Parameters:
filter - the filter that will be used

TableFilter

public TableFilter(Filter filter,
                   int column)
Constructs a TableFilter object.

Parameters:
filter - the filter that will be used
column - the column of the table to filter. ALL_COLUMNS specifies filtering of data on all columns.
Method Detail

filter

public boolean filter(ListTableModel model,
                      Object row)
Decides whether a particular row of a JTable will be filtered.

Parameters:
model - the ListTableModel that holds a reference to the tabular row data
row - the row of the table to filter, represented as an object
Returns:
true if the row is to be filtered, false otherwise

getColumn

public int getColumn()
Returns the column to filter. ALL_COLUMNS indicates that all columns should be filtered.

Returns:
the column of the table to filter

getFilter

public Filter getFilter()
Returns the filter that will be used.

Returns:
the filter in use

setColumn

public void setColumn(int column)
Sets the column to filter. ALL_COLUMNS indicates that all columns should be filtered.

Parameters:
column - the column of the table to filter