Package de.gsi.math

Class MathDataSet

  • All Implemented Interfaces:
    de.gsi.dataset.DataSet, de.gsi.dataset.DataSet2D, de.gsi.dataset.DataSetError, de.gsi.dataset.DataSetMetaData, de.gsi.dataset.EditableDataSet, de.gsi.dataset.event.EventSource, java.io.Serializable

    public class MathDataSet
    extends de.gsi.dataset.spi.DoubleErrorDataSet
    DataSet that automatically transforms source DataSet accordance to DataSetFunction or DataSetValueFunction definition. An optional rate limit is available to limit the number of redundant (GUI) updates if desired.
    Author:
    rstein
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  MathDataSet.DataSetFunction
      simple DataSet transform function definition for single input DataSets
      static interface  MathDataSet.DataSetsFunction
      simple DataSet transform function definition for multiple input DataSets
      static interface  MathDataSet.DataSetValueFunction
      simple DataSet transform function definition, only the y value is being transformed, the x-axis is taken from the source DataSet
      • Nested classes/interfaces inherited from interface de.gsi.dataset.DataSetError

        de.gsi.dataset.DataSetError.ErrorType
    • Field Summary

      • Fields inherited from class de.gsi.dataset.spi.DoubleErrorDataSet

        xValues, yErrorsNeg, yErrorsPos, yValues
      • Fields inherited from interface de.gsi.dataset.DataSet

        DIM_X, DIM_Y, DIM_Z
      • Fields inherited from interface de.gsi.dataset.DataSetMetaData

        TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deregisterListener()  
      protected static java.lang.String getCompositeDataSetName​(java.lang.String transformName, de.gsi.dataset.DataSet... sources)  
      java.util.List<de.gsi.dataset.DataSet> getSourceDataSets()  
      protected void handle​(de.gsi.dataset.event.UpdateEvent event)  
      void registerListener()  
      • Methods inherited from class de.gsi.dataset.spi.DoubleErrorDataSet

        add, add, add, add, add, add, add, add, add, clearData, get, getCapacity, getDataCount, getErrorNegative, getErrorPositive, getErrorsNegative, getErrorsPositive, getValues, getX, getXValues, getY, getYValues, increaseCapacity, remove, remove, resize, set, set, set, set, set, set, set, set, trim
      • Methods inherited from class de.gsi.dataset.spi.AbstractErrorDataSet

        fireInvalidated, getErrorType, getThis, lock, recomputeLimits, setErrorType
      • Methods inherited from class de.gsi.dataset.spi.AbstractDataSet

        addDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getStyle, getWarningList, hashCode, minNeigbourSearchX, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListener
      • Methods inherited from class de.gsi.dataset.spi.AbstractStylable

        getStyle, setStyle
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface de.gsi.dataset.DataSet

        getAxisDescription, getAxisDescriptions, getDataCount, getDataLabel, getIndex, getName, getStyle, getStyle, lock, recomputeLimits, setStyle
      • Methods inherited from interface de.gsi.dataset.DataSet2D

        getDimension, getValue, getValue, getXIndex, getYIndex
      • Methods inherited from interface de.gsi.dataset.DataSetError

        getErrorNegative, getErrorPositive, getErrorType
      • Methods inherited from interface de.gsi.dataset.EditableDataSet

        getEditConstraints, setEditConstraints, setName
      • Methods inherited from interface de.gsi.dataset.event.EventSource

        addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
    • Constructor Detail

      • MathDataSet

        public MathDataSet​(java.lang.String transformName,
                           MathDataSet.DataSetFunction dataSetFunction,
                           de.gsi.dataset.DataSet source)
        Parameters:
        transformName - String defining the prefix of the name of the calculated DataSet
        dataSetFunction - the DataSet in-to-out transform. see MathDataSet.DataSetFunction for details
        source - reference source DataSet N.B. a default minUpdatePeriod of 40 milliseconds and EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE is assumed
      • MathDataSet

        public MathDataSet​(java.lang.String transformName,
                           MathDataSet.DataSetFunction dataSetFunction,
                           long minUpdatePeriod,
                           de.gsi.dataset.event.EventRateLimiter.UpdateStrategy updateStrategy,
                           de.gsi.dataset.DataSet source)
        Parameters:
        transformName - String defining the prefix of the name of the calculated DataSet
        dataSetFunction - the DataSet in-to-out transform. see MathDataSet.DataSetFunction for details
        minUpdatePeriod - the minimum time in milliseconds. With EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE this implies a minimum update time-out
        updateStrategy - if null defaults to EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE, see EventRateLimiter.UpdateStrategy for details
        source - reference source DataSet
      • MathDataSet

        public MathDataSet​(java.lang.String transformName,
                           MathDataSet.DataSetsFunction dataSetFunction,
                           de.gsi.dataset.DataSet... sources)
        Parameters:
        transformName - String defining the prefix of the name of the calculated DataSet
        dataSetFunction - the DataSet in-to-out transform. see MathDataSet.DataSetsFunction for details
        sources - reference source DataSet array N.B. a default minUpdatePeriod of 40 milliseconds and EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE is assumed
      • MathDataSet

        public MathDataSet​(java.lang.String transformName,
                           MathDataSet.DataSetsFunction dataSetFunction,
                           long minUpdatePeriod,
                           de.gsi.dataset.event.EventRateLimiter.UpdateStrategy updateStrategy,
                           de.gsi.dataset.DataSet... sources)
        Parameters:
        transformName - String defining the prefix of the name of the calculated DataSet
        dataSetFunction - the DataSet in-to-out transform. see MathDataSet.DataSetsFunction for details
        minUpdatePeriod - the minimum time in milliseconds. With EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE this implies a minimum update time-out
        updateStrategy - if null defaults to EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE, see EventRateLimiter.UpdateStrategy for details
        sources - reference source DataSet array
      • MathDataSet

        public MathDataSet​(java.lang.String transformName,
                           MathDataSet.DataSetValueFunction dataSetFunction,
                           de.gsi.dataset.DataSet source)
        Parameters:
        transformName - String defining the prefix of the name of the calculated DataSet
        dataSetFunction - the DataSet in-to-out transform. see MathDataSet.DataSetValueFunction for details
        source - reference source DataSet N.B. a default minUpdatePeriod of 40 milliseconds and EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE is assumed
      • MathDataSet

        public MathDataSet​(java.lang.String transformName,
                           MathDataSet.DataSetValueFunction dataSetFunction,
                           long minUpdatePeriod,
                           de.gsi.dataset.event.EventRateLimiter.UpdateStrategy updateStrategy,
                           de.gsi.dataset.DataSet source)
        Parameters:
        transformName - String defining the prefix of the name of the calculated DataSet
        dataSetFunction - the DataSet in-to-out transform. see MathDataSet.DataSetValueFunction for details
        minUpdatePeriod - the minimum time in milliseconds. With EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE this implies a minimum update time-out
        updateStrategy - if null defaults to EventRateLimiter.UpdateStrategy.INSTANTANEOUS_RATE, see EventRateLimiter.UpdateStrategy for details
        source - reference source DataSet
    • Method Detail

      • deregisterListener

        public final void deregisterListener()
      • getSourceDataSets

        public final java.util.List<de.gsi.dataset.DataSet> getSourceDataSets()
      • registerListener

        public final void registerListener()
      • handle

        protected void handle​(de.gsi.dataset.event.UpdateEvent event)
      • getCompositeDataSetName

        protected static java.lang.String getCompositeDataSetName​(java.lang.String transformName,
                                                                  de.gsi.dataset.DataSet... sources)