Class ListDataSet

  • All Implemented Interfaces:
    DataSet, DataSetMetaData, EventSource

    public class ListDataSet
    extends AbstractDataSet<ListDataSet>
    implements DataSet
    Deprecated.
    due to poorer CPU performance (this is kept for reference reasons)
    Implementation of the DataSet interface which keeps the x,y values in an observable list. 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. N.B. this is a classic list-based implementation. This is a "simple" implementation but has a poorer performance compared to Default- and Double-based DataSets @see DoubleDataSet
    Author:
    rstein
    • Field Detail

      • dataLabels

        protected java.util.Map<java.lang.Integer,​java.lang.String> dataLabels
        Deprecated.
      • dataStyles

        protected java.util.Map<java.lang.Integer,​java.lang.String> dataStyles
        Deprecated.
      • data

        protected java.util.ArrayList<DoublePoint> data
        Deprecated.
    • Constructor Detail

      • ListDataSet

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

        public ListDataSet​(java.lang.String name,
                           double[] yValues)
        Deprecated.
        Creates a new instance of CustomDataSet. X coordinates are equal to data points indices.
        Note: The provided array is not copied (data set operates on the specified array object) thus the array should not be modified outside of this data set.
        Parameters:
        name - name of this data set.
        yValues - Y coordinates
        Throws:
        java.lang.IllegalArgumentException - if any of parameters is null
      • ListDataSet

        public ListDataSet​(java.lang.String name,
                           double[] xValues,
                           double[] yValues)
        Deprecated.

        Creates a new instance of CustomDataSet.

        Note: The provided arrays are not copied (data set operates on specified array objects) thus these array should not be modified outside of this data set.
        Parameters:
        name - name of this data set.
        xValues - X coordinates
        yValues - Y coordinates
        Throws:
        java.lang.IllegalArgumentException - if any of parameters is null or if arrays with coordinates have different lengths
      • ListDataSet

        public ListDataSet​(java.lang.String name,
                           java.util.List<DoublePoint> values)
        Deprecated.

        Creates a new instance of CustomDataSet.

        Parameters:
        name - name of this data set.
        values - list of data points to set
        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()
        Deprecated.
        Returns:
        data label map for given data point
      • getDataStyleMap

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

        public java.util.List<DoublePoint> getData()
        Deprecated.
        Returns:
        list containing data point definition
      • getDataCount

        public int getDataCount()
        Deprecated.
        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 ListDataSet clearData()
        Deprecated.
        clear all data points
        Returns:
        itself (fluent design)
      • getX

        public double getX​(int index)
        Deprecated.
        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)
        Deprecated.
        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
      • set

        public ListDataSet set​(java.util.List<DoublePoint> values)
        Deprecated.
        replaces values of all existing data points
        Parameters:
        values - new data points
        Returns:
        itself (fluent design)
      • set

        public ListDataSet set​(int index,
                               double x,
                               double y)
        Deprecated.
        sets new value of existing data point
        Parameters:
        index - data point index
        x - new horizontal value
        y - new vertical value
        Returns:
        itself (fluent design)
      • add

        public ListDataSet add​(double x,
                               double y)
        Deprecated.
        Add point to the DoublePoints object
        Parameters:
        x - coordinate
        y - coordinate
        Returns:
        itself
      • remove

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

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

        public ListDataSet add​(double[] xValues,
                               double[] yValues)
        Deprecated.

        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
      • addDataLabel

        public java.lang.String addDataLabel​(int index,
                                             java.lang.String label)
        Deprecated.
        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<ListDataSet>
        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
      • removeDataLabel

        public java.lang.String removeDataLabel​(int index)
        Deprecated.
        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<ListDataSet>
        Parameters:
        index - of the data point
        Returns:
        the previously set label or null if no label has been specified
      • getDataLabel

        public java.lang.String getDataLabel​(int index)
        Deprecated.
        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<ListDataSet>
        Parameters:
        index - of the data label
        Returns:
        data point label specified by the index or null if no label has been specified
      • addDataStyle

        public java.lang.String addDataStyle​(int index,
                                             java.lang.String style)
        Deprecated.
        A string representation of the CSS style associated with this specific DataSet data point. @see #getStyle()
        Overrides:
        addDataStyle in class AbstractDataSet<ListDataSet>
        Parameters:
        index - the index of the specific data point
        style - for the given data point (CSS-styling)
        Returns:
        itself (fluent interface)
      • removeStyle

        public java.lang.String removeStyle​(int index)
        Deprecated.
        A string representation of the CSS style associated with this specific DataSet data point. @see #getStyle()
        Overrides:
        removeStyle in class AbstractDataSet<ListDataSet>
        Parameters:
        index - the index of the specific data point
        Returns:
        itself (fluent interface)
      • getStyle

        public java.lang.String getStyle​(int index)
        Deprecated.
        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<ListDataSet>
        Parameters:
        index - the index of the specific data point
        Returns:
        user-specific data set style description (ie. may be set by user)