Class EventFactoryImpl<T>

java.lang.Object
dev.upcraft.sparkweave.event.EventFactoryImpl<T>
All Implemented Interfaces:
Event<T>

public class EventFactoryImpl<T> extends Object implements Event<T>
A Simple event system.
ImplNote:
The event system is designed to be as simple as possible, and is not thread safe.
  • Method Details

    • create

      public static <T> Event<T> create(Class<T> type, Function<T[],T> invokerFactory)
    • create

      public static <T> Event<T> create(Class<T> type, T emptyInvoker, Function<T[],T> invokerFactory)
    • register

      public void register(T listener)
      Specified by:
      register in interface Event<T>
    • unregister

      public void unregister(T listener)
      Specified by:
      unregister in interface Event<T>
    • invoker

      public T invoker()
      Specified by:
      invoker in interface Event<T>
    • listenerCount

      public int listenerCount()
      Specified by:
      listenerCount in interface Event<T>