Class DoubleErrorDataSet

    • Field Detail

      • xValues

        protected double[] xValues
      • yValues

        protected double[] yValues
      • yErrorsPos

        protected double[] yErrorsPos
      • yErrorsNeg

        protected double[] yErrorsNeg
      • dataMaxIndex

        protected int dataMaxIndex
    • Constructor Detail

      • DoubleErrorDataSet

        public DoubleErrorDataSet​(java.lang.String name)
        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)
        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​(DataSet another)
        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)

        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

      • getDataLabelMap

        public java.util.Map<java.lang.Integer,​java.lang.String> getDataLabelMap()
        Returns:
        data label map for given data point
      • getDataStyleMap

        public java.util.Map<java.lang.Integer,​java.lang.String> getDataStyleMap()
        Returns:
        data style map (CSS-styling)
      • getXValues

        public double[] getXValues()
        Specified by:
        getXValues in interface DataSet
        Returns:
        the x value array
      • getYValues

        public double[] getYValues()
        Specified by:
        getYValues in interface DataSet
        Returns:
        the y value array
      • getYErrorsPositive

        public double[] getYErrorsPositive()
        Description copied from interface: DataSetError
        Returns the positive error along the y axis for all available data points. Please note that errors are assumed to be always positive!
        Specified by:
        getYErrorsPositive in interface DataSetError
        Returns:
        array containing positive y error
      • getYErrorsNegative

        public double[] getYErrorsNegative()
        Description copied from interface: DataSetError
        Returns the negative error along the Y axis for all available data points. Please note that errors are assumed to be always positive!
        Specified by:
        getYErrorsNegative in interface DataSetError
        Returns:
        array containing negative Y error
      • getDataCount

        public int getDataCount()
        Description copied from interface: DataSet
        Get the number of data points in the data set
        Specified by:
        getDataCount in interface DataSet
        Returns:
        the number of data points
      • clearData

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

        public double getX​(int index)
        Description copied from interface: DataSet
        Gets the x value of the data point with the index i
        Specified by:
        getX in interface DataSet
        Parameters:
        index - the index of the data point
        Returns:
        the x value
      • getY

        public double getY​(int index)
        Description copied from interface: DataSet
        Gets the y value of the data point with the index i
        Specified by:
        getY in interface DataSet
        Parameters:
        index - the index of the data point
        Returns:
        the y value
      • getXErrorNegative

        public double getXErrorNegative​(int index)
        Description copied from interface: DataSetError
        Returns the negative error along the X axis of a point specified by the index. Please note that errors are assumed to be always positive!
        Specified by:
        getXErrorNegative in interface DataSetError
        Parameters:
        index - of negative X error to be returned.
        Returns:
        negative X error
      • getXErrorPositive

        public double getXErrorPositive​(int index)
        Description copied from interface: DataSetError
        Returns the positive error along the X axis of a point specified by the index. Please note that errors are assumed to be always positive!
        Specified by:
        getXErrorPositive in interface DataSetError
        Parameters:
        index - of positive X error to be returned.
        Returns:
        positive X error
      • getYErrorNegative

        public double getYErrorNegative​(int index)
        Description copied from interface: DataSetError
        Returns the negative error along the Y axis of a point specified by the index. Please note that errors are assumed to be always positive!
        Specified by:
        getYErrorNegative in interface DataSetError
        Parameters:
        index - of negative Y error to be returned.
        Returns:
        negative Y error
      • getYErrorPositive

        public double getYErrorPositive​(int index)
        Description copied from interface: DataSetError
        Returns the positive error along the Y axis of a point specified by the index. Please note that errors are assumed to be always positive!
        Specified by:
        getYErrorPositive in interface DataSetError
        Parameters:
        index - of positive Y error to be returned.
        Returns:
        positive Y error
      • set

        public DoubleErrorDataSet set​(int index,
                                      double x,
                                      double y)
        replaces point coordinate of existing data point
        Specified by:
        set in interface 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)
        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)
        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)
        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 EditableDataSet remove​(int index)
        Description copied from interface: EditableDataSet
        remove point from data set
        Specified by:
        remove in interface EditableDataSet
        Parameters:
        index - data point which should be removed
        Returns:
        itself (fluent design)
      • remove

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

        public EditableDataSet add​(int index,
                                   double x,
                                   double y)
        Description copied from interface: EditableDataSet
        add point to the data set
        Specified by:
        add in interface EditableDataSet
        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 DoubleErrorDataSet add​(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)
      • set

        public DoubleErrorDataSet 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 DoubleErrorDataSet 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)
      • set

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