|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.amis.pogamut.base.component.bus.event.EventFilter<T>
T
- public class EventFilter<T>
Class for accepting events - provides description of which event should be checked and method that performs the check.
Preferred way of usage are anonymous classes which override EventFilter#accept(IComponentEvent)
that otherwise
always return null.
Constructor Summary | |
---|---|
EventFilter(Class<T> eventClass)
|
|
EventFilter(Class<T> eventClass,
Class<? extends IComponent> componentClass)
|
|
EventFilter(Class<T> eventClass,
cz.cuni.amis.utils.token.Token componentId)
|
Method Summary | |
---|---|
boolean |
accept(T event)
Whether the event may be accepted. |
Class |
getComponentClass()
If it does not return null - then only events that happened on this class of component may be accepted (this class or descendants). |
cz.cuni.amis.utils.token.Token |
getComponentId()
If it does not return null - then only events from the component of this id may be accepted. |
Class<T> |
getEventClass()
Must return class of the event that the object may accept. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventFilter(Class<T> eventClass)
eventClass
- which events should be examined inside EventFilter#accept(IComponentEvent)
public EventFilter(Class<T> eventClass, Class<? extends IComponent> componentClass)
eventClass
- which events should be examined inside EventFilter#accept(IComponentEvent)
componentClass
- from which component class the events are examined inside EventFilter#accept(IComponentEvent)
public EventFilter(Class<T> eventClass, cz.cuni.amis.utils.token.Token componentId)
eventClass
- which events should be examined inside EventFilter#accept(IComponentEvent)
componentId
- from which component id the events are examined inside EventFilter#accept(IComponentEvent)
Method Detail |
---|
public boolean accept(T event)
WaitForEvent.IEventFilter
accept
in interface WaitForEvent.IEventFilter<T>
public Class getComponentClass()
WaitForEvent.IEventFilter
getComponentClass
in interface WaitForEvent.IEventFilter<T>
public cz.cuni.amis.utils.token.Token getComponentId()
WaitForEvent.IEventFilter
getComponentId
in interface WaitForEvent.IEventFilter<T>
public Class<T> getEventClass()
WaitForEvent.IEventFilter
Must not return null!
getEventClass
in interface WaitForEvent.IEventFilter<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |