public class RowFilters extends Object
RowFilter
s. Trigger is the missing of Pattern/Regex+matchflags factory method in core. Can't do much other than c&p core as both abstract base class GeneralFilter and concrete RowFilter are private. Expose the base as public for custom subclasses
Modifier and Type | Class and Description |
---|---|
static class |
RowFilters.GeneralFilter
C&P from core Swing to allow subclassing.
|
private static class |
RowFilters.RegexFilter
C&P from core to allow richer factory methods.
|
Modifier | Constructor and Description |
---|---|
private |
RowFilters() |
Modifier and Type | Method and Description |
---|---|
static <M,I> RowFilter<M,I> |
regexFilter(int matchFlags,
String regex,
int... indices)
Returns a
RowFilter that uses a regular
expression to determine which entries to include. |
static <M,I> RowFilter<M,I> |
regexFilter(Pattern pattern,
int... indices)
Returns a
RowFilter that uses a regular
expression to determine which entries to include. |
static <M,I> RowFilter<M,I> |
regexFilter(String regex,
int... indices)
Returns a
RowFilter that uses a regular
expression to determine which entries to include. |
private RowFilters()
public static <M,I> RowFilter<M,I> regexFilter(String regex, int... indices)
RowFilter
that uses a regular
expression to determine which entries to include. Only entries
with at least one matching value are included. For
example, the following creates a RowFilter
that
includes entries with at least one value starting with
"a":
RowFilter.regexFilter("^a");
The returned filter uses Matcher.find()
to test for inclusion. To test for exact matches use the
characters '^' and '$' to match the beginning and end of the
string respectively. For example, "^foo$" includes only rows whose
string is exactly "foo" and not, for example, "food". See
Pattern
for a complete description of
the supported regular-expression constructs.
regex
- the regular expression to filter onindices
- the indices of the values to check. If not supplied all
values are evaluatedRowFilter
implementing the specified criteriaNullPointerException
- if regex
is
null
IllegalArgumentException
- if any of the indices
are < 0PatternSyntaxException
- if regex
is
not a valid regular expression.Pattern
public static <M,I> RowFilter<M,I> regexFilter(int matchFlags, String regex, int... indices)
RowFilter
that uses a regular
expression to determine which entries to include. Only entries
with at least one matching value are included. For
example, the following creates a RowFilter
that
includes entries with at least one value starting with
"a" ignoring case:
RowFilter.regexFilter(Pattern.CASE_INSENSITIVE, "^a");
The returned filter uses Matcher.find()
to test for inclusion. To test for exact matches use the
characters '^' and '$' to match the beginning and end of the
string respectively. For example, "^foo$" includes only rows whose
string is exactly "foo" and not, for example, "food". See
Pattern
for a complete description of
the supported regular-expression constructs.
matchFlags
- Match flags, a bit mask that may include
Pattern.CASE_INSENSITIVE
, Pattern.MULTILINE
, Pattern.DOTALL
,
Pattern.UNICODE_CASE
, Pattern.CANON_EQ
, Pattern.UNIX_LINES
,
Pattern.LITERAL
and Pattern.COMMENTS
regex
- the regular expression to filter onindices
- the indices of the values to check. If not supplied all
values are evaluatedRowFilter
implementing the specified criteriaNullPointerException
- if regex
is
null
IllegalArgumentException
- if any of the indices
are < 0IllegalArgumentException
- If bit values other than those corresponding to the defined
match flags are set in flagsPatternSyntaxException
- if regex
is
not a valid regular expression.Pattern
public static <M,I> RowFilter<M,I> regexFilter(Pattern pattern, int... indices)
RowFilter
that uses a regular
expression to determine which entries to include.pattern
- the Pattern to use for matchingindices
- the indices of the values to check. If not supplied all
values are evaluatedRowFilter
implementing the specified criteriaNullPointerException
- if pattern
is
null
Pattern
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses