Class EventHandler<EventType extends Event,Listener extends EventListener<EventType>>

java.lang.Object
com.github.tadukoo.util.event.EventHandler<EventType,Listener>
Type Parameters:
EventType - The Event subclass to handle events for
Listener - The EventListener implementation to send Events to

public abstract class EventHandler<EventType extends Event,Listener extends EventListener<EventType>> extends Object
An abstract class to handle the creation of Events and send them out to the various EventListeners to handle them appropriately.
Version:
0.1-Alpha-SNAPSHOT
Author:
Logan Ferree (Tadukoo)
  • Field Details

  • Constructor Details

    • EventHandler

      public EventHandler()
  • Method Details

    • registerListener

      public final void registerListener(Listener listener)
      Register a EventListener so it will be notified of Events handled by this class.
      Parameters:
      listener - The EventListener to register
    • unregisterListener

      public final void unregisterListener(Listener listener)
      Unregisters a EventListener so it will no longer be notified about Events handled by this class.
      Parameters:
      listener - The EventListener to unregister
    • sendEventToListeners

      protected final void sendEventToListeners(EventType e)
      Sends the given Event out to all of the registered EventListeners.
      Parameters:
      e - The Event to send out