|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.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(java.lang.Class<T> eventClass)
|
|
EventFilter(java.lang.Class<T> eventClass,
java.lang.Class<? extends IComponent> componentClass)
|
|
EventFilter(java.lang.Class<T> eventClass,
Token componentId)
|
Method Summary | |
---|---|
boolean |
accept(T event)
Whether the event may be accepted. |
java.lang.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). |
Token |
getComponentId()
If it does not return null - then only events from the component of this id may be accepted. |
java.lang.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(java.lang.Class<T> eventClass)
eventClass
- which events should be examined inside EventFilter#accept(IComponentEvent)
public EventFilter(java.lang.Class<T> eventClass, java.lang.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(java.lang.Class<T> eventClass, 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 java.lang.Class getComponentClass()
WaitForEvent.IEventFilter
getComponentClass
in interface WaitForEvent.IEventFilter<T>
public Token getComponentId()
WaitForEvent.IEventFilter
getComponentId
in interface WaitForEvent.IEventFilter<T>
public java.lang.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 |