Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class TableFilter

java.lang.Object
  extended by com.citra.filter.TableFilter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CompositeFilter, ListTableFilter, NodeTableFilter, NotTableFilter, ValuesTableFilter

public class TableFilter
extends Object
implements Serializable

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

See Also:
Serialized Form

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.
 boolean filter(TableModel model, int rowIndex)
          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.
 void setFilter(Filter filter)
          Assigns the filter that will be used.
 
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. An alternative to this method is filter(TableModel m, int rowIndex).

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

filter

public boolean filter(TableModel model,
                      int rowIndex)
Decides whether a particular row of a JTable will be filtered. This method is presented as an alternative to filter(ListTableModel ltm, Object o).

Parameters:
model - the TableModel that holds the unfiltered row data
rowIndex - the index of the row of the table to filter
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

setFilter

public void setFilter(Filter filter)
Assigns the filter that will be used.

Parameters:
filter - the assigned filter

Copyright © 2011 Citra Technologies. All Rights Reserved.