create Array Backed
Create an "array-backed" Event instance.
If your factory simply delegates to the listeners without adding custom behavior,consider using the other overload if performance of this event is critical.
Return
The Event instance.
Parameters
The listener class type.
The invoker factory, combining multiple listeners into one instance.
The listener type.
Create an "array-backed" Event instance with a custom empty invoker,for an event whose {@code invokerFactory} only delegates to the listeners.
- If there is no listener, the custom empty invoker will be used.
- If there is only one listener, that one will be used as the invokerand the factory will not be called.
- Only when there are at least two listeners will the factory be used.
Having a custom empty invoker (of type (...) -> {}) increases performancerelative to iterating over an empty array; however, it only really mattersif the event is executed thousands of times a second.
Return
The Event instance.
Parameters
The listener class type.
The custom empty invoker.
The invoker factory, combining multiple listeners into one instance.
The listener type.