Class DoubleErrorDataSet

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

    public class DoubleErrorDataSet
    extends de.gsi.dataset.spi.AbstractErrorDataSet<DoubleErrorDataSet>
    implements de.gsi.dataset.DataSetError, de.gsi.dataset.EditableDataSet
    Deprecated.
    this is kept for reference/performance comparisons only
    Implementation of the DataSetError interface which stores x,y, +eyn, -eyn values in separate double arrays. It provides methods allowing easily manipulate of data points.
    User provides X and Y coordinates or only Y coordinates. In the former case X coordinates have value of data point index. This version being optimised for native double arrays.
    Author:
    rstein
    See Also:
    for an equivalent implementation without errors
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface de.gsi.dataset.DataSetError

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

      Fields 
      Modifier and Type Field Description
      protected int dataMaxIndex
      Deprecated.
       
      protected double[] xValues
      Deprecated.
       
      protected double[] yErrorsNeg
      Deprecated.
       
      protected double[] yErrorsPos
      Deprecated.
       
      protected double[] yValues
      Deprecated.
       
      • Fields inherited from class de.gsi.dataset.spi.AbstractDataSet

        dataLabels, dataStyles, editConstraints, errorList, infoList, lock, metaInfoMap, name, updateListeners, warningList, xRange, yRange
      • Fields inherited from interface de.gsi.dataset.DataSetMetaData

        TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleErrorDataSet​(de.gsi.dataset.DataSet another)
      Deprecated.
      Creates a new instance of DoubleDataSet as copy of another (deep-copy).
      DoubleErrorDataSet​(java.lang.String name)
      Deprecated.
      Creates a new instance of DoubleErrorDataSet.
      DoubleErrorDataSet​(java.lang.String name, double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos, int nData, boolean deepCopy)
      Deprecated.
      Creates a new instance of DoubleErrorDataSet.
      DoubleErrorDataSet​(java.lang.String name, int initalSize)
      Deprecated.
      Creates a new instance of DoubleErrorDataSet.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      DoubleErrorDataSet add​(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos)
      Deprecated.
      Initialises the data set with specified data.
      DoubleErrorDataSet add​(double x, double y)
      Deprecated.
      Add point to the DoublePoints object.
      DoubleErrorDataSet add​(double x, double y, double yErrorNeg, double yErrorPos)
      Deprecated.
      Add point to the DoublePoints object
      de.gsi.dataset.EditableDataSet add​(int index, double x, double y)
      Deprecated.
       
      DoubleErrorDataSet clearData()
      Deprecated.
      clears all data
      int getDataCount()
      Deprecated.
       
      double getX​(int index)
      Deprecated.
       
      double getXErrorNegative​(int index)
      Deprecated.
       
      double getXErrorPositive​(int index)
      Deprecated.
       
      double[] getXValues()
      Deprecated.
       
      double getY​(int index)
      Deprecated.
       
      double getYErrorNegative​(int index)
      Deprecated.
       
      double getYErrorPositive​(int index)
      Deprecated.
       
      double[] getYErrorsNegative()
      Deprecated.
       
      double[] getYErrorsPositive()
      Deprecated.
       
      double[] getYValues()
      Deprecated.
       
      de.gsi.dataset.EditableDataSet remove​(int index)
      Deprecated.
       
      DoubleErrorDataSet remove​(int fromIndex, int toIndex)
      Deprecated.
      remove sub-range of data points
      DoubleErrorDataSet set​(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos)
      Deprecated.
      Initialises the data set with specified data.
      DoubleErrorDataSet set​(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos, boolean copy)
      Deprecated.
      Initialises the data set with specified data.
      DoubleErrorDataSet set​(int index, double x, double y)
      Deprecated.
      replaces point coordinate of existing data point
      DoubleErrorDataSet set​(int index, double x, double y, double yErrorNeg, double yErrorPos)
      Deprecated.
      replaces point coordinate of existing data point
      DoubleErrorDataSet set​(de.gsi.dataset.DataSet other)
      Deprecated.
      clear old data and overwrite with data from 'other' data set (deep copy)
      • Methods inherited from class de.gsi.dataset.spi.AbstractErrorDataSet

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

        addDataLabel, addDataStyle, binarySearchX, binarySearchY, clearMetaInfo, getDataCount, getDataLabel, getDataLabelMap, getDataStyleMap, getEditConstraints, getErrorList, getInfoList, getMetaInfo, getName, getStyle, getUndefValue, getWarningList, getXIndex, getXMax, getXMin, getXRange, getYIndex, getYMax, getYMin, getYRange, isAutoNotification, minNeigbourSearchX, removeDataLabel, removeStyle, setAutoNotifaction, setEditConstraints, setName, toString, updateEventListener
      • Methods inherited from class de.gsi.dataset.spi.AbstractStylable

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

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

        getDataCount, getDataLabel, getName, getStyle, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getYIndex, getYMax, getYMin, isAutoNotification, lock, setAutoNotifaction, setStyle, unlock
      • Methods inherited from interface de.gsi.dataset.DataSetError

        getErrorType, getXErrorNegative, getXErrorPositive, getXErrorsNegative, getXErrorsPositive, getYErrorNegative, getYErrorPositive
      • Methods inherited from interface de.gsi.dataset.EditableDataSet

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

        addListener, invokeListener, invokeListener, removeListener, updateEventListener
    • Field Detail

      • xValues

        protected double[] xValues
        Deprecated.
      • yValues

        protected double[] yValues
        Deprecated.
      • yErrorsPos

        protected double[] yErrorsPos
        Deprecated.
      • yErrorsNeg

        protected double[] yErrorsNeg
        Deprecated.
      • dataMaxIndex

        protected int dataMaxIndex
        Deprecated.
    • Constructor Detail

      • DoubleErrorDataSet

        public DoubleErrorDataSet​(java.lang.String name)
        Deprecated.
        Creates a new instance of DoubleErrorDataSet.
        Parameters:
        name - name of this DataSet.
        Throws:
        java.lang.IllegalArgumentException - if name is null
      • DoubleErrorDataSet

        public DoubleErrorDataSet​(java.lang.String name,
                                  int initalSize)
        Deprecated.
        Creates a new instance of DoubleErrorDataSet.
        Parameters:
        name - name of this DataSet.
        initalSize - maximum capacity of buffer
        Throws:
        java.lang.IllegalArgumentException - if name is null
      • DoubleErrorDataSet

        public DoubleErrorDataSet​(de.gsi.dataset.DataSet another)
        Deprecated.
        Creates a new instance of DoubleDataSet as copy of another (deep-copy).
        Parameters:
        another - name of this DataSet.
      • DoubleErrorDataSet

        public DoubleErrorDataSet​(java.lang.String name,
                                  double[] xValues,
                                  double[] yValues,
                                  double[] yErrorsNeg,
                                  double[] yErrorsPos,
                                  int nData,
                                  boolean deepCopy)
        Deprecated.

        Creates a new instance of DoubleErrorDataSet.

        Parameters:
        name - name of this data set.
        xValues - X coordinates
        yValues - Y coordinates
        yErrorsNeg - Y negative coordinate error
        yErrorsPos - Y positive coordinate error
        nData - how many data points are relevant to be taken
        deepCopy - if true, the input array is copied
        Throws:
        java.lang.IllegalArgumentException - if any of parameters is null or if arrays with coordinates have different lengths
    • Method Detail

      • getXValues

        public double[] getXValues()
        Deprecated.
        Specified by:
        getXValues in interface de.gsi.dataset.DataSet
      • getYValues

        public double[] getYValues()
        Deprecated.
        Specified by:
        getYValues in interface de.gsi.dataset.DataSet
      • getYErrorsPositive

        public double[] getYErrorsPositive()
        Deprecated.
        Specified by:
        getYErrorsPositive in interface de.gsi.dataset.DataSetError
      • getYErrorsNegative

        public double[] getYErrorsNegative()
        Deprecated.
        Specified by:
        getYErrorsNegative in interface de.gsi.dataset.DataSetError
      • getDataCount

        public int getDataCount()
        Deprecated.
        Specified by:
        getDataCount in interface de.gsi.dataset.DataSet
      • clearData

        public DoubleErrorDataSet clearData()
        Deprecated.
        clears all data
        Returns:
        itself (fluent design)
      • getX

        public double getX​(int index)
        Deprecated.
        Specified by:
        getX in interface de.gsi.dataset.DataSet
      • getY

        public double getY​(int index)
        Deprecated.
        Specified by:
        getY in interface de.gsi.dataset.DataSet
      • getXErrorNegative

        public double getXErrorNegative​(int index)
        Deprecated.
        Specified by:
        getXErrorNegative in interface de.gsi.dataset.DataSetError
      • getXErrorPositive

        public double getXErrorPositive​(int index)
        Deprecated.
        Specified by:
        getXErrorPositive in interface de.gsi.dataset.DataSetError
      • getYErrorNegative

        public double getYErrorNegative​(int index)
        Deprecated.
        Specified by:
        getYErrorNegative in interface de.gsi.dataset.DataSetError
      • getYErrorPositive

        public double getYErrorPositive​(int index)
        Deprecated.
        Specified by:
        getYErrorPositive in interface de.gsi.dataset.DataSetError
      • set

        public DoubleErrorDataSet set​(int index,
                                      double x,
                                      double y)
        Deprecated.
        replaces point coordinate of existing data point
        Specified by:
        set in interface de.gsi.dataset.EditableDataSet
        Parameters:
        index - the index of the data point
        x - new horizontal coordinate
        y - new vertical coordinate N.B. errors are implicitly assumed to be zero
        Returns:
        itself (fluent design)
      • set

        public DoubleErrorDataSet set​(int index,
                                      double x,
                                      double y,
                                      double yErrorNeg,
                                      double yErrorPos)
        Deprecated.
        replaces point coordinate of existing data point
        Parameters:
        index - the index of the data point
        x - new horizontal coordinate
        y - new vertical coordinate
        yErrorNeg - new vertical negative error of y (can be asymmetric)
        yErrorPos - new vertical positive error of y (can be asymmetric)
        Returns:
        itself (fluent design)
      • add

        public DoubleErrorDataSet add​(double x,
                                      double y)
        Deprecated.
        Add point to the DoublePoints object. Errors in y are assumed 0.
        Parameters:
        x - the new x coordinate
        y - the new y coordinate
        Returns:
        itself
      • add

        public DoubleErrorDataSet add​(double x,
                                      double y,
                                      double yErrorNeg,
                                      double yErrorPos)
        Deprecated.
        Add point to the DoublePoints object
        Parameters:
        x - the new x coordinate
        y - the new y coordinate
        yErrorNeg - the +dy error
        yErrorPos - the -dy error
        Returns:
        itself
      • remove

        public de.gsi.dataset.EditableDataSet remove​(int index)
        Deprecated.
        Specified by:
        remove in interface de.gsi.dataset.EditableDataSet
      • remove

        public DoubleErrorDataSet remove​(int fromIndex,
                                         int toIndex)
        Deprecated.
        remove sub-range of data points
        Parameters:
        fromIndex - start index
        toIndex - stop index
        Returns:
        itself (fluent design)
      • add

        public de.gsi.dataset.EditableDataSet add​(int index,
                                                  double x,
                                                  double y)
        Deprecated.
        Specified by:
        add in interface de.gsi.dataset.EditableDataSet
      • add

        public DoubleErrorDataSet add​(double[] xValues,
                                      double[] yValues,
                                      double[] yErrorsNeg,
                                      double[] yErrorsPos)
        Deprecated.

        Initialises the data set with specified data.

        Note: The method copies values from specified double arrays.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        yErrorsNeg - the +dy errors
        yErrorsPos - the -dy errors
        Returns:
        itself (fluent design)
      • set

        public DoubleErrorDataSet set​(double[] xValues,
                                      double[] yValues,
                                      double[] yErrorsNeg,
                                      double[] yErrorsPos,
                                      boolean copy)
        Deprecated.

        Initialises the data set with specified data.

        Note: The method copies values from specified double arrays.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        yErrorsNeg - the +dy errors
        yErrorsPos - the -dy errors
        copy - true: makes an internal copy, false: use the pointer as is (saves memory allocation)
        Returns:
        itself (fluent design)
      • set

        public DoubleErrorDataSet set​(double[] xValues,
                                      double[] yValues,
                                      double[] yErrorsNeg,
                                      double[] yErrorsPos)
        Deprecated.

        Initialises the data set with specified data.

        Note: The method copies values from specified double arrays.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        yErrorsNeg - the +dy errors
        yErrorsPos - the -dy errors
        Returns:
        itself (fluent design)
      • set

        public DoubleErrorDataSet set​(de.gsi.dataset.DataSet other)
        Deprecated.
        clear old data and overwrite with data from 'other' data set (deep copy)
        Parameters:
        other - the other data set
        Returns:
        itself (fluent design)