Class TwoErrorDataSet

  • 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
    Direct Known Subclasses:
    JISAErrorDataSet

    public class TwoErrorDataSet
    extends de.gsi.dataset.spi.AbstractErrorDataSet<TwoErrorDataSet>
    implements de.gsi.dataset.DataSet2D, de.gsi.dataset.DataSetError, de.gsi.dataset.EditableDataSet
    See Also:
    Serialized Form
    • 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 it.unimi.dsi.fastutil.doubles.DoubleArrayList xErrorsNeg  
      protected it.unimi.dsi.fastutil.doubles.DoubleArrayList xErrorsPos  
      protected it.unimi.dsi.fastutil.doubles.DoubleArrayList xValues  
      protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yErrorsNeg  
      protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yErrorsPos  
      protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yValues  
      • Fields inherited from class de.gsi.dataset.spi.AbstractDataSet

        axisListener, dimension
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      TwoErrorDataSet​(de.gsi.dataset.DataSet another)
      Creates a new instance of DoubleErrorDataSet as copy of another (deep-copy).
      TwoErrorDataSet​(java.lang.String name)
      Creates a new instance of DoubleErrorDataSet.
      TwoErrorDataSet​(java.lang.String name, int initalSize)
      Creates a new instance of DoubleErrorDataSet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TwoErrorDataSet add​(double[] xValuesNew, double[] yValuesNew, double[] yErrorsNegNew, double[] yErrorsPosNew, double[] xErrorsNegNew, double[] xErrorsPosNew)
      Add array vectors to data set.
      TwoErrorDataSet add​(double x, double y)
      add point to the data set
      TwoErrorDataSet add​(double x, double y, double yErrorNeg, double yErrorPos)
      Add point to the data set.
      TwoErrorDataSet add​(double x, double y, double yErrorNeg, double yErrorPos, double xErrorNeg, double xErrorPos)
      Add point to the data set.
      TwoErrorDataSet add​(double x, double y, double yErrorNeg, double yErrorPos, double xErrorNeg, double xErrorPos, java.lang.String label)
      Add point to the data set.
      TwoErrorDataSet add​(int index, double... newValue)
      add point to the data set
      TwoErrorDataSet add​(int index, double[] x, double[] y, double[] yErrorNeg, double[] yErrorPos)
      add point to the data set
      TwoErrorDataSet add​(int index, double x, double y)
      add point to the data set
      TwoErrorDataSet add​(int index, double x, double y, double yErrorNeg, double yErrorPos)
      add point to the data set
      TwoErrorDataSet add​(int index, double x, double y, double yErrorNeg, double yErrorPos, double xErrorNeg, double xErrorPos)
      add point to the data set
      TwoErrorDataSet add​(int index, double x, double y, double yErrorNeg, double yErrorPos, double xErrorNeg, double xErrorPos, java.lang.String label)
      add point to the data set
      TwoErrorDataSet clearData()
      clears all data
      double get​(int dimIndex, int index)  
      int getCapacity()  
      int getDataCount()  
      double getErrorNegative​(int dimIndex, int index)  
      double getErrorPositive​(int dimIndex, int index)  
      double[] getErrorsNegative​(int dimIndex)  
      double[] getErrorsPositive​(int dimIndex)  
      de.gsi.dataset.DataSetError.ErrorType getErrorType​(int dimIndex)  
      double[] getValues​(int dimIndex)  
      TwoErrorDataSet increaseCapacity​(int amount)  
      TwoErrorDataSet remove​(int index)  
      TwoErrorDataSet remove​(int fromIndex, int toIndex)
      remove sub-range of data points
      TwoErrorDataSet resize​(int size)
      ensures minimum size, enlarges if necessary
      TwoErrorDataSet set​(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos)
      Initialises the data set with specified data.
      TwoErrorDataSet set​(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos, boolean copy)
      Initialises the data set with specified data.
      TwoErrorDataSet set​(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos, int nSamples, boolean copy)
      Initialises the data set with specified data.
      TwoErrorDataSet set​(int index, double... newValue)
      replaces point coordinate of existing data point
      TwoErrorDataSet set​(int index, double[] x, double[] y, double[] yErrorNeg, double[] yErrorPos)  
      TwoErrorDataSet set​(int index, double x, double y)
      replaces point coordinate of existing data point
      TwoErrorDataSet set​(int index, double x, double y, double yErrorNeg, double yErrorPos)
      replaces point coordinate of existing data point
      TwoErrorDataSet set​(de.gsi.dataset.DataSet other, boolean copy)
      clear old data and overwrite with data from 'other' data set (deep copy)
      TwoErrorDataSet trim()
      Trims the arrays list so that the capacity is equal to the size.
      • Methods inherited from class de.gsi.dataset.spi.AbstractErrorDataSet

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

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

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

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

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

        getDimension, getValue, getX, getXIndex, getXValues, getY, getYIndex, getYValues
      • Methods inherited from interface de.gsi.dataset.DataSetError

        getErrorNegative, getErrorPositive
      • 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
    • Field Detail

      • xValues

        protected it.unimi.dsi.fastutil.doubles.DoubleArrayList xValues
      • yValues

        protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yValues
      • xErrorsPos

        protected it.unimi.dsi.fastutil.doubles.DoubleArrayList xErrorsPos
      • xErrorsNeg

        protected it.unimi.dsi.fastutil.doubles.DoubleArrayList xErrorsNeg
      • yErrorsPos

        protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yErrorsPos
      • yErrorsNeg

        protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yErrorsNeg
    • Constructor Detail

      • TwoErrorDataSet

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

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

        public TwoErrorDataSet​(java.lang.String name,
                               int initalSize)
        Creates a new instance of DoubleErrorDataSet.
        Parameters:
        name - name of this DataSet.
        initalSize - initial capacity of buffer (N.B. size=0)
        Throws:
        java.lang.IllegalArgumentException - if name is null
    • Method Detail

      • add

        public TwoErrorDataSet add​(double x,
                                   double y)
        add point to the data set
        Parameters:
        x - horizontal coordinate of the new data point
        y - vertical coordinate of the new data point
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(double x,
                                   double y,
                                   double yErrorNeg,
                                   double yErrorPos)
        Add point to the data set.
        Parameters:
        x - the new x coordinate
        y - the new y coordinate
        yErrorNeg - the +dy error
        yErrorPos - the -dy error
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(double x,
                                   double y,
                                   double yErrorNeg,
                                   double yErrorPos,
                                   double xErrorNeg,
                                   double xErrorPos)
        Add point to the data set.
        Parameters:
        x - the new x coordinate
        y - the new y coordinate
        yErrorNeg - the +dy error
        yErrorPos - the -dy error
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(double x,
                                   double y,
                                   double yErrorNeg,
                                   double yErrorPos,
                                   double xErrorNeg,
                                   double xErrorPos,
                                   java.lang.String label)
        Add point to the data set.
        Parameters:
        x - the new x coordinate
        y - the new y coordinate
        yErrorNeg - the +dy error
        yErrorPos - the -dy error
        label - the data label
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(double[] xValuesNew,
                                   double[] yValuesNew,
                                   double[] yErrorsNegNew,
                                   double[] yErrorsPosNew,
                                   double[] xErrorsNegNew,
                                   double[] xErrorsPosNew)
        Add array vectors to data set.
        Parameters:
        xValuesNew - X coordinates
        yValuesNew - Y coordinates
        yErrorsNegNew - the +dy errors
        yErrorsPosNew - the -dy errors
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(int index,
                                   double... newValue)
        add point to the data set
        Specified by:
        add in interface de.gsi.dataset.EditableDataSet
        Parameters:
        index - data point index at which the new data point should be added
        newValue - new data point coordinate
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(int index,
                                   double x,
                                   double y)
        add point to the data set
        Parameters:
        index - data point index at which the new data point should be added
        x - horizontal coordinate of the new data point
        y - vertical coordinate of the new data point
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(int index,
                                   double x,
                                   double y,
                                   double yErrorNeg,
                                   double yErrorPos)
        add point to the data set
        Parameters:
        index - data point index at which the new data point should be added
        x - horizontal coordinate of the new data point
        y - vertical coordinate of the new data point
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(int index,
                                   double x,
                                   double y,
                                   double yErrorNeg,
                                   double yErrorPos,
                                   double xErrorNeg,
                                   double xErrorPos)
        add point to the data set
        Parameters:
        index - data point index at which the new data point should be added
        x - horizontal coordinate of the new data point
        y - vertical coordinate of the new data point
        yErrorNeg - the +dy error
        yErrorPos - the -dy error
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(int index,
                                   double x,
                                   double y,
                                   double yErrorNeg,
                                   double yErrorPos,
                                   double xErrorNeg,
                                   double xErrorPos,
                                   java.lang.String label)
        add point to the data set
        Parameters:
        index - data point index at which the new data point should be added
        x - horizontal coordinates of the new data point
        y - vertical coordinates of the new data point
        yErrorNeg - the +dy error
        yErrorPos - the -dy error
        label - data point label (see CategoryAxis)
        Returns:
        itself (fluent design)
      • add

        public TwoErrorDataSet add​(int index,
                                   double[] x,
                                   double[] y,
                                   double[] yErrorNeg,
                                   double[] yErrorPos)
        add point to the data set
        Parameters:
        index - data point index at which the new data point should be added
        x - horizontal coordinate of the new data point
        y - vertical coordinate of the new data point
        yErrorNeg - the +dy error
        yErrorPos - the -dy error
        Returns:
        itself (fluent design)
      • clearData

        public TwoErrorDataSet clearData()
        clears all data
        Returns:
        itself (fluent design)
      • get

        public final double get​(int dimIndex,
                                int index)
        Specified by:
        get in interface de.gsi.dataset.DataSet
      • getCapacity

        public int getCapacity()
        Returns:
        storage capacity of dataset
      • getDataCount

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

        public double getErrorNegative​(int dimIndex,
                                       int index)
        Specified by:
        getErrorNegative in interface de.gsi.dataset.DataSetError
      • getErrorPositive

        public double getErrorPositive​(int dimIndex,
                                       int index)
        Specified by:
        getErrorPositive in interface de.gsi.dataset.DataSetError
      • getErrorsNegative

        public double[] getErrorsNegative​(int dimIndex)
        Specified by:
        getErrorsNegative in interface de.gsi.dataset.DataSetError
      • getErrorsPositive

        public double[] getErrorsPositive​(int dimIndex)
        Specified by:
        getErrorsPositive in interface de.gsi.dataset.DataSetError
      • getValues

        public final double[] getValues​(int dimIndex)
        Specified by:
        getValues in interface de.gsi.dataset.DataSet
        Overrides:
        getValues in class de.gsi.dataset.spi.AbstractDataSet<TwoErrorDataSet>
      • increaseCapacity

        public TwoErrorDataSet increaseCapacity​(int amount)
        Parameters:
        amount - storage capacity increase
        Returns:
        itself (fluent design)
      • remove

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

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

        public TwoErrorDataSet resize​(int size)
        ensures minimum size, enlarges if necessary
        Parameters:
        size - the actually used array lengths
        Returns:
        itself (fluent design)
      • set

        public TwoErrorDataSet set​(de.gsi.dataset.DataSet other,
                                   boolean copy)
        clear old data and overwrite with data from 'other' data set (deep copy)
        Specified by:
        set in interface de.gsi.dataset.DataSet
        Parameters:
        other - the other data set
        copy - true: perform a deep copy (default), false: reuse the other dataset's internal data structures (if applicable)
        Returns:
        itself (fluent design)
      • set

        public TwoErrorDataSet set​(double[] xValues,
                                   double[] yValues,
                                   double[] yErrorsNeg,
                                   double[] yErrorsPos)

        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)
      • getErrorType

        public de.gsi.dataset.DataSetError.ErrorType getErrorType​(int dimIndex)
        Specified by:
        getErrorType in interface de.gsi.dataset.DataSetError
        Overrides:
        getErrorType in class de.gsi.dataset.spi.AbstractErrorDataSet<TwoErrorDataSet>
      • set

        public TwoErrorDataSet set​(double[] xValues,
                                   double[] yValues,
                                   double[] yErrorsNeg,
                                   double[] yErrorsPos,
                                   boolean copy)

        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 TwoErrorDataSet set​(double[] xValues,
                                   double[] yValues,
                                   double[] yErrorsNeg,
                                   double[] yErrorsPos,
                                   int nSamples,
                                   boolean copy)

        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
        nSamples - number of samples to be copied
        copy - true: makes an internal copy, false: use the pointer as is (saves memory allocation)
        Returns:
        itself (fluent design)
      • set

        public TwoErrorDataSet set​(int index,
                                   double... newValue)
        replaces point coordinate of existing data point
        Specified by:
        set in interface de.gsi.dataset.EditableDataSet
        Parameters:
        index - data point index at which the new data point should be added
        newValue - new data point coordinate
        Returns:
        itself (fluent design)
      • set

        public TwoErrorDataSet set​(int index,
                                   double x,
                                   double y)
        replaces point coordinate of existing data point
        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 TwoErrorDataSet set​(int index,
                                   double x,
                                   double y,
                                   double yErrorNeg,
                                   double yErrorPos)
        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)
      • set

        public TwoErrorDataSet set​(int index,
                                   double[] x,
                                   double[] y,
                                   double[] yErrorNeg,
                                   double[] yErrorPos)
      • trim

        public TwoErrorDataSet trim()
        Trims the arrays list so that the capacity is equal to the size.
        Returns:
        itself (fluent design)
        See Also:
        ArrayList.trimToSize()