org.fuin.utils4j.filter
Class RegExprFilter

java.lang.Object
  extended by org.fuin.utils4j.filter.RegExprFilter
All Implemented Interfaces:
Filter

public class RegExprFilter
extends java.lang.Object
implements Filter

Defines a filter based on a regular expression.


Field Summary
static int FIND
          The find method scans the input sequence looking for the next subsequence that matches the pattern.
static int LOOKING_AT
          The lookingAt method attempts to match the input sequence, starting at the beginning, against the pattern.
static int MATCHES
          The matches method attempts to match the entire input sequence against the pattern.
 
Constructor Summary
RegExprFilter(java.lang.String pattern)
          Constructor with pattern.
 
Method Summary
 boolean complies(java.lang.Object obj)
          Checks if the argument complies with the condition of the filter.
 java.lang.String getPattern()
          Return the pattern.
 int getType()
          Returns the type of the matching.
 java.lang.String getTypeName()
          Returns the type name of the matching.
 void setType(int type)
          Sets the type of the matching.
 void setTypeName(java.lang.String typeName)
          Sets the type name of the matching.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MATCHES

public static final int MATCHES
The matches method attempts to match the entire input sequence against the pattern.

See Also:
Constant Field Values

LOOKING_AT

public static final int LOOKING_AT
The lookingAt method attempts to match the input sequence, starting at the beginning, against the pattern.

See Also:
Constant Field Values

FIND

public static final int FIND
The find method scans the input sequence looking for the next subsequence that matches the pattern.

See Also:
Constant Field Values
Constructor Detail

RegExprFilter

public RegExprFilter(java.lang.String pattern)
Constructor with pattern.

Parameters:
pattern - Pattern to use (Cannot be NULL!)
Method Detail

complies

public final boolean complies(java.lang.Object obj)
Checks if the argument complies with the condition of the filter.

Specified by:
complies in interface Filter
Parameters:
obj - Object to be tested for compliance
Returns:
If object complies TRUE else FALSE is returned.

getPattern

public final java.lang.String getPattern()
Return the pattern.

Returns:
Pattern

toString

public final java.lang.String toString()

Overrides:
toString in class java.lang.Object

getType

public final int getType()
Returns the type of the matching.

Returns:
Type (0,1,2)

setType

public final void setType(int type)
Sets the type of the matching.

Parameters:
type - Type (0,1,2)

getTypeName

public final java.lang.String getTypeName()
Returns the type name of the matching.

Returns:
Type name ("matches", "lookingAt" or "find") or NULL (="lookingAt")

setTypeName

public final void setTypeName(java.lang.String typeName)
Sets the type name of the matching.

Parameters:
typeName - Type name ("matches", "lookingAt" or "find") or NULL (="lookingAt")


Copyright © 2009 Future Invent Informationsmanagement GmbH. All Rights Reserved.