T - event typepublic class EventBus<T> extends ListenerList<EventListener<T>>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
EventBus.SubclassEventListener<E extends T,T>
A wrapper for an event listener that only accepts a specific type of
event.
|
ListenerList.EventListenerNodefirst, last, PRIORITY_DEFAULT, PRIORITY_HIGH, PRIORITY_LOW| Constructor and Description |
|---|
EventBus() |
| Modifier and Type | Method and Description |
|---|---|
<E extends T> |
add(EventListener<E> listener,
java.lang.Class<E> clazz)
Adds an IEventListener to the list that only accepts a specific subclass
of <T>
|
<E extends T> |
add(EventListener<E> listener,
java.lang.Class<E> clazz,
int priority)
Adds an IEventListener to the list that only accepts a specific subclass
of <T>
|
void |
publish(T event)
Publishes an event by calling all of the registered listeners.
|
public void publish(T event)
event - event to be publishedpublic <E extends T> ListenerHandle<EventListener<T>> add(EventListener<E> listener, java.lang.Class<E> clazz)
E - event typelistener - listener to registerclazz - class to listen forpublic <E extends T> ListenerHandle<EventListener<T>> add(EventListener<E> listener, java.lang.Class<E> clazz, int priority)
E - event typelistener - listener to registerclazz - class to listen forpriority - listener priority