public class BasicSimEventSource extends java.lang.Object implements SimEventSource
isMyEvent()
method.
27 October 2006 - ab - removed isMyEvent()Modifier and Type | Field and Description |
---|---|
private java.util.List<SimEventListener> |
listeners
The SimEventListeners who have registered.
|
private static java.util.logging.Logger |
LOGGER |
Constructor and Description |
---|
BasicSimEventSource()
Construct a new BasicSimEventSource.
|
Modifier and Type | Method and Description |
---|---|
void |
addSimEventListener(SimEventListener listener)
Registers the given SimEventListener to be notified of all SimEvents from
this source.
|
SimEventListener[] |
getSimEventListeners()
Returns a copy of the currently registered SimEventListeners.
|
void |
notifyListeners(SimEvent event)
Causes all registered SimEventListeners to be notified of the given SimEvent.
|
void |
removeSimEventListener(SimEventListener listener)
Unregisters the given SimEventListener.
|
private static final java.util.logging.Logger LOGGER
private final java.util.List<SimEventListener> listeners
public BasicSimEventSource()
public void addSimEventListener(SimEventListener listener)
addSimEventListener
in interface SimEventSource
listener
- The SimEventListener that is the new listener.public void removeSimEventListener(SimEventListener listener)
removeSimEventListener
in interface SimEventSource
listener
- The SimEventListener to be removed as a listener.public void notifyListeners(SimEvent event)
notifyListeners
in interface SimEventSource
event
- The SimEvent that all SimEventListeners are notified has occurred.public SimEventListener[] getSimEventListeners()
getSimEventListeners
in interface SimEventSource