Class Event.Impl<L>
java.lang.Object
com.thecsdev.common.event.Event.Impl<L>
- Type Parameters:
L- Event listener type.
- All Implemented Interfaces:
Event<L>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Event
Event.Impl<L> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanaddListener(@NonNull L listener) final voidfinal booleancontainsListener(@NonNull L listener) Checks if a listener is added to thisEvent.final @NonNull Linvoker()final booleanremoveListener(@NonNull L listener)
-
Constructor Details
-
Impl
- Throws:
NullPointerException
-
-
Method Details
-
invoker
-
addListener
Description copied from interface:Event- Specified by:
addListenerin interfaceEvent<L>- Parameters:
listener- The listener that will be invoked when thisEventis fired.- Returns:
falseif the listener was already registered,trueotherwise.- Throws:
NullPointerException- If the argument isnull.
-
removeListener
Description copied from interface:Event- Specified by:
removeListenerin interfaceEvent<L>- Parameters:
listener- The listener to be removed.- Returns:
trueif the listener was registered before removal,falseotherwise.- Throws:
NullPointerException- If the argument isnull.
-
clearListeners
-
containsListener
Description copied from interface:EventChecks if a listener is added to thisEvent.- Specified by:
containsListenerin interfaceEvent<L>- Parameters:
listener- The listener to check for.- Returns:
trueif the listener is added,falseotherwise.- Throws:
NullPointerException- If the argument isnull.
-