|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jguiraffe.gui.builder.event.filter.AbstractEventFilter
public abstract class AbstractEventFilter
An abstract base class for event filters.
This class can be used as base class by simple event filters that do not need
to bother with specialties like null values or non event objects.
The class can be configured whether it should accept null values or
not. It can be initialized with a base class that must be derived from
BuilderEvent. All objects accepted by this filter must then
be of this class or one of its subclasses
In this class a base implementation of the accept() method is
provided, which casts the passed in object to an event object and then
delegates to the abstract acceptEvent() method.
| Constructor Summary | |
|---|---|
protected |
AbstractEventFilter()
Creates a new instance of AbstractEventFilter. |
protected |
AbstractEventFilter(java.lang.Class<?> baseClass)
Creates a new instance of AbstractEventFilter and
initializes it with the base class. |
protected |
AbstractEventFilter(java.lang.Class<?> baseClass,
boolean acceptNull)
Creates a new instance of AbstractEventFilter and
initializes it with the base class and the acceptNull
flag. |
| Method Summary | |
|---|---|
boolean |
accept(java.lang.Object obj)
Tests whether the passed in object is accepted by this filter. |
protected abstract boolean |
acceptEvent(BuilderEvent event)
Tests if the passed in event object is accepted by this filter. |
java.lang.Class<?> |
getBaseClass()
Returns the base class. |
boolean |
isAcceptNull()
Returns the acceptNull flag. |
void |
setAcceptNull(boolean acceptNull)
Sets the acceptNull flag. |
void |
setBaseClass(java.lang.Class<?> baseClass)
Sets the base class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractEventFilter()
AbstractEventFilter. The base
class is set to BuilderEvent; null values won't
be accepted.
protected AbstractEventFilter(java.lang.Class<?> baseClass)
AbstractEventFilter and
initializes it with the base class. null values won't be
accepted.
baseClass - the base class (must no be null)
protected AbstractEventFilter(java.lang.Class<?> baseClass,
boolean acceptNull)
AbstractEventFilter and
initializes it with the base class and the acceptNull
flag.
baseClass - the base class (must no be null)acceptNull - a flag if null values are accepted| Method Detail |
|---|
public boolean accept(java.lang.Object obj)
acceptEvent(BuilderEvent) method.
accept in interface EventFilterobj - the object to test
public boolean isAcceptNull()
acceptNull flag.
public void setAcceptNull(boolean acceptNull)
acceptNull flag. If a null value is
passed to the accept() method, the value of this flag is
returned.
acceptNull - a flag if null values are acceptedpublic java.lang.Class<?> getBaseClass()
public void setBaseClass(java.lang.Class<?> baseClass)
BuilderEvent.
baseClass - the base classprotected abstract boolean acceptEvent(BuilderEvent event)
accept().
event - the event to be tested
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||