Package de.gsi.dataset.event
Interface EventSource
-
- All Known Subinterfaces:
CategoryHistogram,DataSet,DataSet2D,DataSet3D,DataSetError,EditableDataSet,Histogram,Histogram1D,TestDataSet<D>
- All Known Implementing Classes:
AbstractDataSet,AbstractDataSet3D,AbstractErrorDataSet,AbstractHistogram,AbstractStylable,AbstractTestFunction,AveragingDataSet,CircularDoubleErrorDataSet,CosineFunction,DefaultDataSet,DefaultErrorDataSet,DimReductionDataSet,DoubleDataSet,DoubleDataSet3D,DoubleErrorDataSet,FifoDoubleErrorDataSet,FloatDataSet,FragmentedDataSet,GaussFunction,Histogram,Histogram2,LabelledMarkerDataSet,LimitedIndexedTreeDataSet,ListDataSet,ListErrorDataSet,MultiDimDoubleDataSet,RandomStepFunction,RandomWalkFunction,RollingDataSet,SincFunction,SineFunction,SingleOutlierFunction,TransposedDataSet,TransposedDataSet.TransposedDataSet3D,TriangleFunction,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.java.util.concurrent.atomic.AtomicBooleanautoNotification()Set the automatic notification of invalidation listeners.default voidinvokeListener()invoke object within update listener listdefault voidinvokeListener(UpdateEvent updateEvent)invoke object within update listener listdefault voidinvokeListener(UpdateEvent updateEvent, boolean executeParallel)invoke object within update listener listdefault booleanisAutoNotification()Checks it automatic notification is enabled.default 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
-
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)
-
autoNotification
java.util.concurrent.atomic.AtomicBoolean autoNotification()
Set the automatic notification of invalidation listeners. In general, data sets should notify registered invalidation listeners, if the data in the data set has changed. Charts usually register an invalidation listener with the data set to be notified of any changes and update the charts. Setting the automatic notification to false, allows applications to prevent this behaviour, in case data sets are updated multiple times during an acquisition cycle but the chart update is only required at the end of the cycle.truefor automatic notification- Returns:
- the atomic boolean
-
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
-
invokeListener
default void invokeListener(UpdateEvent updateEvent, boolean executeParallel)
invoke object within update listener list- Parameters:
updateEvent- the event the listeners are notified withexecuteParallel-trueexecute event listener via parallel executor service
-
isAutoNotification
default boolean isAutoNotification()
Checks it automatic notification is enabled.- Returns:
trueif automatic notification is enabled
-
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)
-
updateEventListener
java.util.List<EventListener> updateEventListener()
- Returns:
- list containing all update event listener (needs to be provided by implementing class)
-
-