Class EventDispatcher<E extends EventListener,T>

java.lang.Object
org.oscim.event.EventDispatcher<E,T>
Type Parameters:
T - the event source type
E - the event 'data' type

public abstract class EventDispatcher<E extends EventListener,T> extends Object
The Class EventDispatcher.

Events MUST be dispatched from main-loop! To add events from other threads use: Map.post(new Runnable(){ public void run(tell(event,data);)};);

  • Field Details

  • Constructor Details

    • EventDispatcher

      public EventDispatcher()
  • Method Details

    • bind

      public void bind(E listener)
      Bind listener for event notifications.
    • unbind

      public void unbind(E listener)
      Remove listener.
    • tell

      public abstract void tell(E listener, Event event, T data)
      Tell listeners whats going on.
      Parameters:
      event - the event
      data - the data
    • fire

      public void fire(Event event, T data)
    • clear

      public void clear()
      Remove all listeners.