T
- Listener interface
.public class ListenerSet<T>
extends java.util.HashSet<T>
implements java.lang.reflect.InvocationHandler
interface
and allows you to invoke the defined method upon the whole group via a
getProxy()
.Proxy.newProxyInstance(ClassLoader, Class[], InvocationHandler)
,
Serialized FormConstructor and Description |
---|
ListenerSet(java.lang.Class<? super T> clazz)
Creates a new instance of listener set for the supplied listener type.
|
ListenerSet(java.lang.Class<? super T> clazz,
java.util.Set<? extends T> listeners)
Creates a new instance of listener set for the supplied listener type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e) |
T |
getProxy()
Gets the group proxy for easy invocation of methods upon the group.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
boolean |
remove(java.lang.Object o) |
clear, clone, contains, isEmpty, iterator, size, spliterator
addAll, containsAll, retainAll, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
public ListenerSet(java.lang.Class<? super T> clazz)
clazz
- Listener type to store.public boolean add(T e)
public T getProxy()
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable