|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.filter.Filter
com.citra.filter.StringFilter
public class StringFilter
A string filter.
This filter has four modes: EQUALS, CONTAINS, BEGINS_WITH and ENDS_WITH. It can also be case sensitive/insensitive.
Field Summary | |
---|---|
static int |
BEGINS_WITH
The mode that tests if a string begins with the supplied object. |
protected boolean |
caseSensitive
boolean denoting case sensitivity. |
static int |
CONTAINS
The mode that tests if a string is contained in the supplied object. |
static int |
ENDS_WITH
The mode that tests if a string ends with the supplied object. |
static int |
EQUALS
The mode that tests for equality of the supplied object. |
protected int |
mode
The current filter mode. |
protected boolean |
negate
boolean indicating whether the string filter returns the negative of the result of each mode. |
protected String |
pattern
The filter expression. |
Fields inherited from class com.citra.filter.Filter |
---|
acceptNull |
Constructor Summary | |
---|---|
StringFilter()
Constructs a StringFilter with a default CONTAINS mode and no negation. |
|
StringFilter(String pattern)
Constructs a StringFilter with a default CONTAINS mode, no negation and a string pattern equal to pattern. |
Method Summary | |
---|---|
boolean |
accept(Object value)
Decides whether to accept the value supplied. |
boolean |
accept(String expression)
Matches the String expression against the current filter. |
Object |
getFilterPattern()
Returns the object used as the filter pattern. |
int |
getMode()
Returns the mode of this StringFilter. |
String |
getPattern()
Returns the filter expression. |
boolean |
isCaseSensitive()
Determines if this string filter is case sensitive. |
boolean |
isNegate()
Determines the negation behaviour of the filter. |
void |
setCaseSensitive(boolean caseSensitive)
Sets the case sensitivity of this string filter. |
void |
setFilterPattern(Object filter)
Sets an object as the filter pattern. |
void |
setMode(int mode)
Sets the mode of this StringFilter to mode . |
void |
setNegate(boolean negate)
Sets the negation behaviour of the filter. |
void |
setPattern(String pattern)
Sets the filter expression. |
Methods inherited from class com.citra.filter.Filter |
---|
getAcceptNull, setAcceptNull |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int EQUALS
public static final int CONTAINS
public static final int BEGINS_WITH
public static final int ENDS_WITH
protected int mode
protected boolean caseSensitive
protected String pattern
protected boolean negate
Constructor Detail |
---|
public StringFilter()
public StringFilter(String pattern)
Method Detail |
---|
public boolean accept(Object value)
accept
in class Filter
value
- the object we want to decide if it will be filtered or not.
public boolean accept(String expression)
expression
against the current filter.
expression
- the string to match
public Object getFilterPattern()
getFilterPattern
in class Filter
public int getMode()
public String getPattern()
public boolean isCaseSensitive()
public boolean isNegate()
public void setCaseSensitive(boolean caseSensitive)
caseSensitive
- the case sensitivitypublic void setFilterPattern(Object filter)
filter
to the appropriate object.
setFilterPattern
in class Filter
filter
- the object to set as the filter patternpublic void setMode(int mode)
mode
.
It can either be EQUALS, CONTAINS, BEGINS_WITH or ENDS_WITH.
mode
- the mode of this string filter.public void setNegate(boolean negate)
negate
- true if the filter will negate the result, false otherwise.public void setPattern(String pattern)
pattern
- the filter expression.
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |