|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sciapp.filter.NumericFilter
public class NumericFilter
A general numeric filter. This filter is suitable for all Number objects, although the actual filtering uses only int values.
If the filter pattern is not a number, then this filter will match all objects.
Field Summary | |
---|---|
static int |
EQUAL_TO
The mode that tests if a number is equal to another. |
static int |
LESS_EQUAL_TO
The mode that tests if a number is less than or equal to another. |
static int |
LESS_THAN
The mode that tests if a number is less than another. |
protected int |
mode
The current filtering mode. |
static int |
MORE_EQUAL_TO
The mode that tests if a number more or equal to another. |
static int |
MORE_THAN
The mode that tests if a number is more than another. |
protected String[] |
options
The options presented to the user. |
protected int |
value
The filter pattern as an integer value. |
Constructor Summary | |
---|---|
NumericFilter()
Constructs a NumericFilter with an EQUAL_TO operation mode. |
Method Summary | |
---|---|
boolean |
accept(int i)
Matches the integer value i against the current filter. |
boolean |
accept(Object value)
Matches a specified object against the current filter. |
String[] |
getDescriptions()
Returns a string array representing the filter options presented to the user. |
int |
getMode()
Returns the current filter operation mode. |
Object |
getPattern()
Returns the object used as the filter pattern. This object is always an Integer, regardless of what object we used in setPattern. |
void |
setMode(int mode)
Sets the operation mode of the filter. |
void |
setPattern(int i)
Sets the filter pattern to i. |
void |
setPattern(Object pattern)
Defines an abstract object to be used as the filter pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LESS_THAN
public static final int LESS_EQUAL_TO
public static final int EQUAL_TO
public static final int MORE_EQUAL_TO
public static final int MORE_THAN
protected int value
protected int mode
protected String[] options
Constructor Detail |
---|
public NumericFilter()
Method Detail |
---|
public boolean accept(int i)
i
against the current filter.
i
- the integer to match
public boolean accept(Object value)
accept
in interface Filter
value
- the object we want to match
public String[] getDescriptions()
getDescriptions
in interface Filter
public int getMode()
getMode
in interface Filter
public Object getPattern()
This object is always an Integer, regardless of what object we used in setPattern.
getPattern
in interface Filter
public void setMode(int mode)
setMode
in interface Filter
mode
- the operation modepublic void setPattern(int i)
i
- an integer value used as the filter pattern.public void setPattern(Object pattern)
setPattern
in interface Filter
pattern
- the filter pattern
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |