T - public class EventFilter<T> extends Object implements WaitForEvent.IEventFilter<T>
Preferred way of usage are anonymous classes which override EventFilter#accept(IComponentEvent) that otherwise
always return null.
| Constructor and Description |
|---|
EventFilter(Class<T> eventClass) |
EventFilter(Class<T> eventClass,
Class<? extends IComponent> componentClass) |
EventFilter(Class<T> eventClass,
cz.cuni.amis.utils.token.Token componentId) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 boolean accept(T event)
WaitForEvent.IEventFilteraccept in interface WaitForEvent.IEventFilter<T>public Class getComponentClass()
WaitForEvent.IEventFiltergetComponentClass in interface WaitForEvent.IEventFilter<T>public cz.cuni.amis.utils.token.Token getComponentId()
WaitForEvent.IEventFiltergetComponentId in interface WaitForEvent.IEventFilter<T>public Class<T> getEventClass()
WaitForEvent.IEventFilterMust not return null!
getEventClass in interface WaitForEvent.IEventFilter<T>Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.