com.jstatcom.model
Class SymbolEventSupport
- java.lang.Object
-
- com.jstatcom.model.SymbolEventSupport
-
public final class SymbolEventSupport extends java.lang.ObjectA support class forSymbolobjects that manages adding, removing and notification of the differentSymbolListener. The events fired indispatchare fired within the AWT event dispatching thread.This class is not thread-save but clients must handle synchronization.
-
-
Constructor Summary
Constructors Constructor and Description SymbolEventSupport()SymbolEventSupportconstructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddListener(SymbolListener evtListener, SymbolEventTypes evtType)AddsevtListenerto the list of listeners for events of typeevtType.voiddispatchEvent(SymbolEvent evt)Dispatchesevtby callingvalueChangedof all registered listeners to events of typeevt.getType.java.util.List<SymbolListener>getListenersForType(SymbolEventTypes evtType)Gets a list with all registered listeners forevtType.voidremoveListener(SymbolListener evtListener)RemovesevtListenerfrom all listener lists.java.lang.StringtoString()Gets a string representation of this.
-
-
-
Method Detail
-
addListener
public void addListener(SymbolListener evtListener, SymbolEventTypes evtType)
AddsevtListenerto the list of listeners for events of typeevtType.- Parameters:
evtListener- theSymbolListenerthat gets notified whenever an event ofevtTypeoccursevtType- the event type- Throws:
java.lang.IllegalArgumentException-if (evtListener == null || evtType == null)
-
dispatchEvent
public void dispatchEvent(SymbolEvent evt)
Dispatchesevtby callingvalueChangedof all registered listeners to events of typeevt.getType. ThevalueChangedmethods are called within the event dispatching thread.- Parameters:
evt- the event to be dispatched- Throws:
java.lang.IllegalArgumentException-if (evt == null)
-
getListenersForType
public java.util.List<SymbolListener> getListenersForType(SymbolEventTypes evtType)
Gets a list with all registered listeners forevtType.- Parameters:
evtType- the event type- Returns:
- a copy of the respective list or an initialized list instance
with size == 0 if no listeners are registered for
evtType
-
removeListener
public void removeListener(SymbolListener evtListener)
RemovesevtListenerfrom all listener lists. Nothing happens ifevtListeneris currently not a listener.- Parameters:
evtListener- theSymbolListenerto be removed- Throws:
java.lang.IllegalArgumentException-if (evtListener == null)
-
toString
public java.lang.String toString()
Gets a string representation of this.- Overrides:
toStringin classjava.lang.Object- Returns:
- informative string representation
-
-
DMelt 3.0 © DataMelt by jWork.ORG