Exemplo n.º 1
0
 /** Adds an action to be executed when the given method is called. */
 public void add(String methodName, Action<?> action) {
   broadcast.add(methodName, action);
 }
Exemplo n.º 2
0
 /**
  * Adds the given listeners.
  *
  * @param listeners The listeners
  */
 public void addAll(Iterable<? extends T> listeners) {
   for (T listener : listeners) {
     broadcast.add(listener);
   }
 }
Exemplo n.º 3
0
 /** Adds a {@link Dispatch} to receive events from this broadcast. */
 public void add(Dispatch<MethodInvocation> dispatch) {
   broadcast.add(dispatch);
 }
Exemplo n.º 4
0
 /**
  * Adds a listener.
  *
  * @param listener The listener.
  */
 public void add(T listener) {
   broadcast.add(listener);
 }
Exemplo n.º 5
0
 /**
  * Returns {@code true} if no listeners are registered with this object.
  *
  * @return {@code true} if no listeners are registered with this object, {@code false} otherwise
  */
 public boolean isEmpty() {
   return broadcast.isEmpty();
 }
Exemplo n.º 6
0
 /**
  * Broadcasts the given event to all listeners.
  *
  * @param event The event
  */
 public void dispatch(MethodInvocation event) {
   broadcast.dispatch(event);
 }
Exemplo n.º 7
0
 /** Removes all listeners. */
 public void removeAll() {
   broadcast.removeAll();
 }
Exemplo n.º 8
0
 /**
  * Removes the given listener.
  *
  * @param listener The listener.
  */
 public void remove(Object listener) {
   broadcast.remove(listener);
 }