|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.core.Filter | +--gishur.core.ClassFilter
A Filter
, that accepts (rejects) an Object
, if it is
(not) an instance of a (any) class stored. One can add classes via the
constructors or an add-method. The method setAcceptMode(boolean)
switches
the behaviour of the filter.
Constructor Summary | |
ClassFilter(java.lang.Class cls)
Single class Constructor. |
Method Summary | |
boolean |
acceptMode()
If the returned value is true , the filter accepts
Objects that are instances of at least one class stored at
this filter. |
void |
add(java.lang.Class cls)
Adds a Class object to the list of classes accepted / rejected
by this filter (depends on acceptMode() ). |
void |
add(java.lang.Class[] cls)
Adds an array of classes to the list of classes accepted / rejected by this filter (depends on acceptMode() ). |
void |
add(java.util.Enumeration enum)
Adds an Enumeration of classes to the list of classes
accepted / rejected by this filter (depends on acceptMode() ). |
protected boolean |
check(java.lang.Object obj)
This method should be overwritten in order to perform the filtering. |
void |
setAcceptMode(boolean mode)
Sets the mode of the ClassFilter ; if the given value is
true , the filter accepts Objects that are
instances of at least one class stored at this filter. |
java.lang.String |
toString()
Overrides java.lang.Object.toString() . |
Methods inherited from class gishur.core.Filter |
addFilter, nextFilter, removeFilter, valid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClassFilter(java.lang.Class cls)
cls
- class that is allowedMethod Detail |
public java.lang.String toString()
java.lang.Object.toString()
.toString
in class java.lang.Object
Object.toString()
public void add(java.lang.Class cls)
Class
object to the list of classes accepted / rejected
by this filter (depends on acceptMode()
).cls
- Class to add.public void add(java.lang.Class[] cls)
acceptMode()
).cls
- array of classes to add.public void add(java.util.Enumeration enum)
Enumeration
of classes to the list of classes
accepted / rejected by this filter (depends on acceptMode()
).enum
- Enumeration
of classes to add.public void setAcceptMode(boolean mode)
ClassFilter
; if the given value is
true
, the filter accepts Objects
that are
instances of at least one class stored at this filter. If the given value
is false
, the filter accepts Objects
that are
not instances of any of the classes stored at this filter.mode
- the mode to setacceptMode()
public boolean acceptMode()
true
, the filter accepts
Objects
that are instances of at least one class stored at
this filter. If the returned value is false
, the filter
accepts Objects
that are not instances of any of the classes
stored at this filter.setAcceptMode(boolean)
protected boolean check(java.lang.Object obj)
check
in class Filter
obj
- the Object
to be testedtrue
, if the given Object is not filtered-out
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |