Modifier and Type | Method and Description |
---|---|
static <T> Event<T> |
createArrayBacked(Class<? super T> type,
Function<T[],T> invokerFactory)
Create an "array-backed" Event instance.
|
static <T> Event<T> |
createArrayBacked(Class<T> type,
T emptyInvoker,
Function<T[],T> invokerFactory)
Create an "array-backed" Event instance with a custom empty invoker.
|
static String |
getHandlerName(Object handler)
Get the listener object name.
|
static void |
invalidate()
Invalidate and re-create all existing "invoker" instances across
events created by this EventFactory.
|
static boolean |
isProfilingEnabled() |
public static boolean isProfilingEnabled()
public static void invalidate()
public static <T> Event<T> createArrayBacked(Class<? super T> type, Function<T[],T> invokerFactory)
T
- The listener type.type
- The listener class type.invokerFactory
- The invoker factory, combining multiple listeners into one instance.public static <T> Event<T> createArrayBacked(Class<T> type, T emptyInvoker, Function<T[],T> invokerFactory)
Having a custom empty invoker (of type (...) -> {}) increases performance relative to iterating over an empty array; however, it only really matters if the event is executed thousands of times a second.
T
- The listener type.type
- The listener class type.emptyInvoker
- The custom empty invoker.invokerFactory
- The invoker factory, combining multiple listeners into one instance.