public class PatternFilter extends Filter implements PatternMatcher
| Modifier and Type | Field and Description |
|---|---|
protected java.util.regex.Pattern |
pattern |
adapter, fromPrevious, pipeline| Constructor and Description |
|---|
PatternFilter()
Instantiates a includeAll PatternFilter with matchFlag 0 on
column 0.
|
PatternFilter(java.lang.String regularExpr,
int matchFlags,
int col)
Instantiates a PatternFilter with a Pattern compiled from the
given regex and matchFlags on the column in model coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
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 output ("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)
Convenience to set the pattern in terms of a regex and
matchFlags, which are used to compile the pattern to apply.
|
boolean |
test(int row)
Tests whether the given row (in this filter's coordinates) should
be added.
|
assign, convertRowIndexToModel, convertRowIndexToView, fireFilterChanged, getColumnIndex, getColumnName, getInputSize, getInputString, getInputValue, getMappingFilter, getPipeline, getStringAt, getValueAt, isCellEditable, mapTowardView, refresh, refresh, setColumnIndex, setValueAtpublic PatternFilter()
public PatternFilter(java.lang.String regularExpr,
int matchFlags,
int col)
regularExpr - the regex to compile, a null or empty String
is interpreted as ".*"matchFlags - the matchflags to use in the compilecol - the column to filter in model coordinates.public void setPattern(java.lang.String regularExpr,
int matchFlags)
regularExpr - the regex to compile, a null or empty String
is interpreted as ".*"matchFlags - the matchflags to use in the compilefor detailspublic void setPattern(java.util.regex.Pattern pattern)
setPattern in interface PatternMatcherpattern - the pattern used by this filter for matchingPatternpublic java.util.regex.Pattern getPattern()
getPattern in interface PatternMatcherPatternprotected void reset()
protected void filter()
public boolean test(int row)
PENDING JW: why is this public? called from a protected method?
row - the row to testpublic int getSize()
protected int mapTowardModel(int row)
getSize();mapTowardModel in class Filter