public class EventEmitter<T extends EventListener> extends Object implements Iterable<T>
Modifier and Type | Class and Description |
---|---|
protected class |
EventEmitter.EventInvocationHandler |
Constructor and Description |
---|
EventEmitter(Class<T> clazz,
ClassLoader loader,
ExceptionHandler<T> handler) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(T listener) |
protected InvocationHandler |
createInvocationHandler() |
T |
emitter() |
int |
getListenerCount() |
T[] |
getListeners() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
static <T extends EventListener> |
newEmitter(Class<T> listenerClass) |
static <T extends EventListener> |
newEmitter(Class<T> listenerClass,
ClassLoader loader) |
static <T extends EventListener> |
newEmitter(Class<T> listenerClass,
ClassLoader loader,
ExceptionHandler<T> handler) |
static <T extends EventListener> |
newEmitter(Class<T> listenerClass,
ExceptionHandler<T> handler) |
void |
removeListener(T listener) |
void |
setExceptionHandler(ExceptionHandler<T> exceptionHandler) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public EventEmitter(Class<T> clazz, ClassLoader loader, ExceptionHandler<T> handler)
public static <T extends EventListener> EventEmitter<T> newEmitter(Class<T> listenerClass)
public static <T extends EventListener> EventEmitter<T> newEmitter(Class<T> listenerClass, ClassLoader loader)
public static <T extends EventListener> EventEmitter<T> newEmitter(Class<T> listenerClass, ExceptionHandler<T> handler)
public static <T extends EventListener> EventEmitter<T> newEmitter(Class<T> listenerClass, ClassLoader loader, ExceptionHandler<T> handler)
public void addListener(T listener)
public void removeListener(T listener)
public T[] getListeners()
public void setExceptionHandler(ExceptionHandler<T> exceptionHandler)
public int getListenerCount()
public boolean isEmpty()
public Iterator<T> iterator()
iterator
in interface Iterable<T extends EventListener>
public T emitter()
protected InvocationHandler createInvocationHandler()