Package dev.prozilla.pine.common.event
Interface EventDispatcherProvider<EventType extends Enum<EventType>,Target,E extends Event<EventType,Target>>
- All Superinterfaces:
EventDispatcherContext<EventType,Target, E>
- All Known Implementing Classes:
Node
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@ProviderOf(EventDispatcher.class)
@FunctionalInterface
public interface EventDispatcherProvider<EventType extends Enum<EventType>,Target,E extends Event<EventType,Target>>
extends EventDispatcherContext<EventType,Target,E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.prozilla.pine.common.event.EventDispatcherContext
EventDispatcherContext.EphemeralEventListener<EventType extends Enum<EventType>,E extends Event<EventType, ?>> -
Method Summary
Modifier and TypeMethodDescriptiondefault EventListener<E> addListener(EventType eventType, EventListener<E> listener) Adds a listener that listens to a given type of event.default voidInvokes the event of a given type with a given target.default voidremoveListener(EventType eventType, EventListener<E> listener) Removes a listener that was listening to a given type of event.Methods inherited from interface dev.prozilla.pine.common.event.EventDispatcherContext
addListener, addTargetedListener, dispatchEvent, off, on, once
-
Method Details
-
getEventDispatcher
EventDispatcher<EventType,Target, getEventDispatcher()E> -
addListener
Description copied from interface:EventDispatcherContextAdds a listener that listens to a given type of event.Unicity is not required. If a listener is added multiple times, it will be called multiple times per event.
- Specified by:
addListenerin interfaceEventDispatcherContext<EventType extends Enum<EventType>,Target, E extends Event<EventType, Target>> - Parameters:
eventType- The type of event to listen tolistener- The listener to add- Returns:
- The listener that was added.
-
removeListener
Description copied from interface:EventDispatcherContextRemoves a listener that was listening to a given type of event.- Specified by:
removeListenerin interfaceEventDispatcherContext<EventType extends Enum<EventType>,Target, E extends Event<EventType, Target>> - Parameters:
eventType- The type of event that was being listened tolistener- The listener to remove
-
invoke
Description copied from interface:EventDispatcherContextInvokes the event of a given type with a given target.
-