org.jdesktop.swingx.decorator
Class PatternFilter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.Filter
      extended by org.jdesktop.swingx.decorator.PatternFilter
All Implemented Interfaces:
PatternMatcher

public class PatternFilter
extends Filter
implements PatternMatcher

Pluggable pattern filter.


Field Summary
protected  java.util.regex.Pattern pattern
           
 
Fields inherited from class org.jdesktop.swingx.decorator.Filter
adapter, fromPrevious, pipeline
 
Constructor Summary
PatternFilter()
           
PatternFilter(java.lang.String regularExpr, int matchFlags, int col)
           
 
Method Summary
protected  void filter()
          Performs the filter operation defined by this filter.
 java.util.regex.Pattern getPattern()
          Returns the pattern used by this filter for matching.
 int getSize()
          Returns the number of records that remain in this filter's "view" after the input records have been filtered.
protected  void init()
          Provides filter-specific initialization.
protected  int mapTowardModel(int row)
          PRE: 0 <= row < getSize();
protected  void reset()
          Resets the internal row mappings from this filter to the previous filter.
 void setPattern(java.util.regex.Pattern pattern)
          Sets the pattern used by this filter for matching.
 void setPattern(java.lang.String regularExpr, int matchFlags)
           
 boolean test(int row)
           
 
Methods inherited from class org.jdesktop.swingx.decorator.Filter
assign, convertRowIndexToModel, convertRowIndexToView, getColumnIndex, getColumnName, getInputSize, getInputValue, getPipeline, getValueAt, isCellEditable, mapTowardView, refresh, refresh, setColumnIndex, setValueAt, translateFromPreviousFilter, translateToPreviousFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

protected java.util.regex.Pattern pattern
Constructor Detail

PatternFilter

public PatternFilter()

PatternFilter

public PatternFilter(java.lang.String regularExpr,
                     int matchFlags,
                     int col)
Method Detail

init

protected void init()
Description copied from class: Filter
Provides filter-specific initialization. Called from the Filter constructor.

Specified by:
init in class Filter

setPattern

public void setPattern(java.lang.String regularExpr,
                       int matchFlags)

setPattern

public void setPattern(java.util.regex.Pattern pattern)
Sets the pattern used by this filter for matching.

Specified by:
setPattern in interface PatternMatcher
Parameters:
pattern - the pattern used by this filter for matching
See Also:
Pattern

getPattern

public java.util.regex.Pattern getPattern()
Returns the pattern used by this filter for matching.

Specified by:
getPattern in interface PatternMatcher
Returns:
the pattern used by this filter for matching
See Also:
Pattern

reset

protected void reset()
Resets the internal row mappings from this filter to the previous filter.

Specified by:
reset in class Filter

filter

protected void filter()
Description copied from class: Filter
Performs the filter operation defined by this filter.

Specified by:
filter in class Filter

test

public boolean test(int row)
Parameters:
row -
Returns:

getSize

public int getSize()
Description copied from class: Filter
Returns the number of records that remain in this filter's "view" after the input records have been filtered.

Specified by:
getSize in class Filter
Returns:
the number of records that remain in this filter's "view" after the input records have been filtered

mapTowardModel

protected int mapTowardModel(int row)
Description copied from class: Filter
PRE: 0 <= row < getSize();

Specified by:
mapTowardModel in class Filter
Returns: