Package de.gsi.dataset.event
Interface EventSource
-
- All Known Subinterfaces:
DataSet,DataSet3D,DataSetError,EditableDataSet,Histogram,Histogram1D,TestDataSet<D>
- All Known Implementing Classes:
AbstractDataSet,AbstractDataSet3D,AbstractErrorDataSet,AbstractHistogram,AbstractStylable,AbstractTestFunction,AveragingDataSet,CircularDoubleErrorDataSet,CosineFunction,DefaultDataSet,DefaultErrorDataSet,DoubleDataSet,DoubleDataSet3D,DoubleErrorDataSet,FifoDoubleErrorDataSet,FloatDataSet,FragmentedDataSet,GaussFunction,Histogram,Histogram2,LabelledMarkerDataSet,LimitedIndexedTreeDataSet,ListDataSet,ListErrorDataSet,RandomStepFunction,RandomWalkFunction,RollingDataSet,SincFunction,SineFunction,SingleOutlierFunction,WrappedDataSet
public interface EventSource- Author:
- rstein
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddListener(EventListener listener)Adds anEventListenerwhich will be notified whenever theObservablebecomes invalid.default voidinvokeListener()invoke object within update listener listdefault voidinvokeListener(UpdateEvent updateEvent)invoke object within update listener listdefault voidremoveListener(EventListener listener)Removes the given listener from the list of listeners, that are notified whenever the value of theUpdateSourcebecomes invalid.java.util.List<EventListener>updateEventListener()
-
-
-
Method Detail
-
updateEventListener
java.util.List<EventListener> updateEventListener()
- Returns:
- list containing all update event listener (needs to be provided by implementing class)
-
addListener
default void addListener(EventListener listener)
Adds anEventListenerwhich will be notified whenever theObservablebecomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.Note that the same actual
InvalidationListenerinstance may be safely registered for differentUpdateSource.The
UpdateSourcestores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak.- Parameters:
listener- The listener to register- Throws:
java.lang.NullPointerException- if the listener is null- See Also:
removeListener(EventListener)
-
removeListener
default void removeListener(EventListener listener)
Removes the given listener from the list of listeners, that are notified whenever the value of theUpdateSourcebecomes invalid.If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
- Parameters:
listener- The listener to remove- Throws:
java.lang.NullPointerException- if the listener is null- See Also:
addListener(EventListener)
-
invokeListener
default void invokeListener()
invoke object within update listener list
-
invokeListener
default void invokeListener(UpdateEvent updateEvent)
invoke object within update listener list- Parameters:
updateEvent- the event the listeners are notified with
-
-