|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sciapp.filter.Filter
com.sciapp.filter.StringFilter
public class StringFilter
A string filter.
This filter has three modes: EQUALS, CONTAINS, BEGINS_WITH and ENDS_WITH. It can alsobe 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.sciapp.filter.Filter |
|---|
acceptNull |
| Constructor Summary | |
|---|---|
StringFilter()
Constructs a StringFilter with a default CONTAINS mode and no negation. |
|
| 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.sciapp.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()
| Method Detail |
|---|
public boolean accept(Object value)
accept in class Filtervalue - 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 Filterpublic 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 Filterfilter - 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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||