Class LimitedIndexedTreeDataSet

    • Constructor Detail

      • LimitedIndexedTreeDataSet

        public LimitedIndexedTreeDataSet​(java.lang.String name,
                                         int maxQueueSize)
        Creates a new instance of DefaultDataSet.
        Parameters:
        name - name of this DataSet.
        maxQueueSize - maximum number of samples that is being stored
        Throws:
        java.lang.IllegalArgumentException - if name is null
      • LimitedIndexedTreeDataSet

        public LimitedIndexedTreeDataSet​(java.lang.String name,
                                         int maxQueueSize,
                                         double maxLength)
        Creates a new instance of DefaultDataSet.
        Parameters:
        name - name of this DataSet.
        maxQueueSize - maximum number of samples that is being stored
        maxLength - maximum length between first and last sample
        Throws:
        java.lang.IllegalArgumentException - if name is null
    • Method Detail

      • add

        public LimitedIndexedTreeDataSet add​(double x,
                                             double y)
        Parameters:
        x - coordinate
        y - coordinate
        Returns:
        itself
      • add

        public LimitedIndexedTreeDataSet add​(double x,
                                             double y,
                                             double ex,
                                             double ey,
                                             java.lang.String... labelStyle)
        add new point
        Parameters:
        x - horizontal point coordinate
        y - vertical point coordinate
        ex - horizontal point error
        ey - vertical point error Note: point errors are expected to be positive
        labelStyle - optional varadic argument containing the data label (first index) and data style (second index)
        Returns:
        itself
      • add

        public LimitedIndexedTreeDataSet add​(double[] xValues,
                                             double[] yValues)
        Adds data points to this data set.
        If usingXValues flag is set to false - array with X coordinates is not taken into account (may be null) otherwise both arrays must be non-null and have the same length.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        Returns:
        itself
      • add

        public LimitedIndexedTreeDataSet add​(double[] xValues,
                                             double[] yValues,
                                             double[] xErrors,
                                             double[] yErrors,
                                             java.lang.String... labelStyle)
        Adds data points to this data set.
        If usingXValues flag is set to false - array with X coordinates is not taken into account (may be null) otherwise both arrays must be non-null and have the same length.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        xErrors - horizontal errors
        yErrors - vertical errors
        labelStyle - optional varadic argument containing the data label (first index) and data style (second index)
        Returns:
        itself
      • addDataLabel

        public java.lang.String addDataLabel​(int index,
                                             java.lang.String label)
        adds a custom new data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.
        Overrides:
        addDataLabel in class AbstractDataSet<LimitedIndexedTreeDataSet>
        Parameters:
        index - of the data point
        label - for the data point specified by the index
        Returns:
        the previously set label or null if no label has been specified
      • addDataStyle

        public java.lang.String addDataStyle​(int index,
                                             java.lang.String style)
        A string representation of the CSS style associated with this specific DataSet data point. @see #getStyle()
        Overrides:
        addDataStyle in class AbstractDataSet<LimitedIndexedTreeDataSet>
        Parameters:
        index - the index of the specific data point
        style - data point CSS-style
        Returns:
        the previously set style or null if no label has been specified
      • expire

        public void expire()
        checks X data range and removes old data points if they exceed the maximum data range
        See Also:
        setMaxLength(double)
      • expire

        public void expire​(double now)
        checks X data range and removes old data points if they exceed the maximum data range
        Parameters:
        now - actual time stamp to be taken as a 't0' reference
        See Also:
        setMaxLength(double)
      • get

        public double get​(int dimIndex,
                          int i)
        Description copied from interface: DataSet
        Gets the x value of the data point with the index i
        Specified by:
        get in interface DataSet
        Parameters:
        dimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')
        i - data point index
        Returns:
        the x value
      • getDataCount

        public int getDataCount​(int dimIndex)
        Description copied from interface: DataSet
        Get the number of data points in the data set for a specific dimension.
        Specified by:
        getDataCount in interface DataSet
        Parameters:
        dimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')
        Returns:
        the number of data points
      • getDataLabel

        public java.lang.String getDataLabel​(int index)
        Returns label of a data point specified by the index. The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.
        Specified by:
        getDataLabel in interface DataSet
        Overrides:
        getDataLabel in class AbstractDataSet<LimitedIndexedTreeDataSet>
        Parameters:
        index - of the data label
        Returns:
        data point label specified by the index or null if no label has been specified
      • getErrorNegative

        public double getErrorNegative​(int dimIndex,
                                       int index)
        Description copied from interface: DataSetError
        Returns the negative error along the 'dimIndex' axis of a point specified by the index. Please note that errors are assumed to be always positive!
        Specified by:
        getErrorNegative in interface DataSetError
        Parameters:
        dimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')
        index - of negative 'dimIndex' error to be returned.
        Returns:
        negative 'dimIndex' error
      • getErrorPositive

        public double getErrorPositive​(int dimIndex,
                                       int index)
        Description copied from interface: DataSetError
        Returns the positive error along the 'dimIndex' axis of a point specified by the index. Please note that errors are assumed to be always positive!
        Specified by:
        getErrorPositive in interface DataSetError
        Parameters:
        dimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')
        index - of positive 'dimIndex' error to be returned.
        Returns:
        positive 'dimIndex' error
      • getMaxLength

        public double getMaxLength()
        Returns:
        maximum X range before points are getting dropped
      • getMaxQueueSize

        public int getMaxQueueSize()
        Returns:
        maximum number of data points before points are getting dropped
      • getStyle

        public java.lang.String getStyle​(int index)
        A string representation of the CSS style associated with this specific DataSet data point. @see #getStyle()
        Specified by:
        getStyle in interface DataSet
        Overrides:
        getStyle in class AbstractDataSet<LimitedIndexedTreeDataSet>
        Parameters:
        index - the index of the specific data point
        Returns:
        user-specific data set style description (ie. may be set by user)
      • isSubtractOffset

        public boolean isSubtractOffset()
        Returns:
        true: normalise x-Axis to last value
      • remove

        public LimitedIndexedTreeDataSet remove​(int fromIndex,
                                                int toIndex)
        remove sub-range of data points
        Parameters:
        fromIndex - starting index
        toIndex - stopping index
        Returns:
        itself (fluent design)
      • remove

        public LimitedIndexedTreeDataSet remove​(int[] indices)
        Removes from this data set points with specified indices.
        Parameters:
        indices - array of indicices to be removed
        Returns:
        itself
      • removeDataLabel

        public java.lang.String removeDataLabel​(int index)
        remove a custom data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.
        Overrides:
        removeDataLabel in class AbstractDataSet<LimitedIndexedTreeDataSet>
        Parameters:
        index - of the data point
        Returns:
        the previously set label or null if no label has been specified
      • removeStyle

        public java.lang.String removeStyle​(int index)
        A string representation of the CSS style associated with this specific DataSet data point. @see #getStyle()
        Overrides:
        removeStyle in class AbstractDataSet<LimitedIndexedTreeDataSet>
        Parameters:
        index - the index of the specific data point
        Returns:
        the previously set style or null if no label has been specified
      • set

        public LimitedIndexedTreeDataSet set​(double[] xValues,
                                             double[] yValues)

        Initialises the data set with specified data.

        Note: The method copies values from specified double arrays.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        Returns:
        itself
      • set

        public LimitedIndexedTreeDataSet set​(double[] xValues,
                                             double[] yValues,
                                             double[] xErrors,
                                             double[] yErrors,
                                             int count)

        Initialises the data set with specified data.

        Note: The method copies values from specified double arrays.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        xErrors - symmetric X coordinate errors
        yErrors - symmetric Y coordinate errors
        count - number of points to be taken from specified arrays.
        Returns:
        itself
      • set

        public LimitedIndexedTreeDataSet set​(double[] xValues,
                                             double[] yValues,
                                             double[] yErrors,
                                             int count)

        Initialises the data set with specified data.

        Note: The method copies values from specified double arrays.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        yErrors - symmetric Y coordinate errors
        count - number of points to be taken from specified arrays.
        Returns:
        itself
      • set

        public LimitedIndexedTreeDataSet set​(double[] xValues,
                                             double[] yValues,
                                             int count)

        Initialises the data set with specified data.

        Note: The method copies values from specified double arrays.
        Parameters:
        xValues - X coordinates
        yValues - Y coordinates
        count - number of points to be taken from specified arrays.
        Returns:
        itself
      • set

        public LimitedIndexedTreeDataSet set​(int index,
                                             double x,
                                             double y)
        Sets the point with index to the new coordinate
        Parameters:
        index - the point index of the data set
        x - the horizontal coordinate of the data point
        y - the vertical coordinate of the data point
        Returns:
        itself
      • set

        public LimitedIndexedTreeDataSet set​(int index,
                                             double x,
                                             double y,
                                             double dx,
                                             double dy)
        Sets the point with index to the new coordinate
        Parameters:
        index - the point index of the data set
        x - the horizontal coordinate of the data point
        y - the vertical coordinate of the data point
        dx - the horizontal error
        dy - the vertical error N.B. assumes symmetric errors
        Returns:
        itself
      • setMaxLength

        public LimitedIndexedTreeDataSet setMaxLength​(double maxLength)
        Parameters:
        maxLength - maximum X range before points are getting dropped
        Returns:
        itself (fluent design)
      • setMaxQueueSize

        public LimitedIndexedTreeDataSet setMaxQueueSize​(int maxQueueSize)
        Parameters:
        maxQueueSize - maximum number of data points before points are getting dropped
        Returns:
        itself (fluent design)
      • setSubtractOffset

        public void setSubtractOffset​(boolean subtractOffset)
        Parameters:
        subtractOffset - true: normalise x-Axis to last value