org.ckkloverdos.filter
Class REFilter
java.lang.Object
org.ckkloverdos.filter.REFilter
- All Implemented Interfaces:
- IFilter
public class REFilter
- extends java.lang.Object
- implements IFilter
An implementation of IFilter
for which the filtering
is based on a regular expression.
This assumes that the client code always passes an implementation of either
CharSequence
or ICharSequence
as the first
paramater to accept(Object, Object)
, otherwise
- Author:
- Christos KK Loverdos
Constructor Summary |
REFilter(java.util.regex.Pattern pattern)
|
REFilter(java.lang.String pattern)
|
REFilter(java.lang.String pattern,
int flags)
|
Method Summary |
boolean |
accept(java.lang.Object object,
java.lang.Object hints)
Tests if object can be found or
matched according to the regular expression
provided in one of the constructors. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HINT_FIND
public static final java.lang.Object HINT_FIND
HINT_MATCH
public static final java.lang.Object HINT_MATCH
REFilter
public REFilter(java.lang.String pattern)
REFilter
public REFilter(java.lang.String pattern,
int flags)
REFilter
public REFilter(java.util.regex.Pattern pattern)
accept
public boolean accept(java.lang.Object object,
java.lang.Object hints)
- Tests if
object
can be found
or
matched
according to the regular expression
provided in one of the constructors.
If hints
is HINT_MATCH
then Matcher.matches()
is used, otherwise Matcher.find()
is used.
- Specified by:
accept
in interface IFilter
- Parameters:
object
- hints
-
Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.