Class DefaultEventListenerSupport<T>
java.lang.Object
VASSAL.tools.concurrent.listener.DefaultEventListenerSupport<T>
- All Implemented Interfaces:
EventListenerSupport<T>
A class to provide support for
EventListener
s.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates aDefaultEventListenerSupport
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventListener
(EventListener<? super T> l) Adds anEventListener
.List
<EventListener<? super T>> Gets the list of listeners.boolean
Checks whether there are anyEventListener
s.void
Notify the listeners of an event.void
removeEventListener
(EventListener<? super T> l) Removes anEventListener
.
-
Field Details
-
listeners
-
src
-
-
Constructor Details
-
DefaultEventListenerSupport
Creates aDefaultEventListenerSupport
.- Parameters:
src
- the source of events
-
-
Method Details
-
addEventListener
Adds anEventListener
.- Specified by:
addEventListener
in interfaceEventListenerSupport<T>
- Parameters:
l
- the listener to add
-
removeEventListener
Removes anEventListener
.- Specified by:
removeEventListener
in interfaceEventListenerSupport<T>
- Parameters:
l
- the listener to remove
-
hasEventListeners
public boolean hasEventListeners()Checks whether there are anyEventListener
s.- Specified by:
hasEventListeners
in interfaceEventListenerSupport<T>
- Returns:
true
if there are any listeners
-
getEventListeners
Gets the list of listeners.- Specified by:
getEventListeners
in interfaceEventListenerSupport<T>
- Returns:
- the list of listeners
-
notify
Notify the listeners of an event.- Specified by:
notify
in interfaceEventListenerSupport<T>
- Parameters:
event
- the event to send
-