Interface DataSet

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      int getDataCount()
      Get the number of data points in the data set
      int getDataCount​(double xmin, double xmax)
      Gets the number of data points in the range xmin to xmax.
      java.lang.String getDataLabel​(int index)
      Returns label of a data point specified by the index.
      java.lang.String getName()
      Gets the name of the data set.
      java.lang.String getStyle()
      A string representation of the CSS style associated with this specific DataSet.
      java.lang.String getStyle​(int index)
      A string representation of the CSS style associated with this specific DataSet data point.
      java.lang.Double getUndefValue()
      Returns the value for undefined data points.
      default double getValue​(double x)
      Gets the interpolated y value of the data point for given x coordinate
      double getX​(int i)
      Gets the x value of the data point with the index i
      int getXIndex​(double x)
      Gets the index of the data point closest to the given x coordinate.
      double getXMax()
      Gets the maximum x value of the data set.
      double getXMin()
      Gets the minimum x value of the data set.
      default double[] getXValues()  
      double getY​(int i)
      Gets the y value of the data point with the index i
      int getYIndex​(double y)
      Gets the first index of the data point closest to the given y coordinate.
      double getYMax()
      Gets the maximum y value of the data set.
      double getYMin()
      Gets the minimum y value of the data set.
      default double[] getYValues()  
      boolean isAutoNotification()
      Checks it automatic notification is enabled.
      DataSet lock()
      Locks access to the data set.
      DataSet setAutoNotifaction​(boolean flag)
      Set the automatic notification of invalidation listeners.
      DataSet setStyle​(java.lang.String style)
      A string representation of the CSS style associated with this specific DataSet.
      DataSet unlock()
      Unlock the data set.
    • Method Detail

      • getName

        java.lang.String getName()
        Gets the name of the data set.
        Returns:
        the name of the DataSet
      • lock

        DataSet lock()
        Locks access to the data set. Multi-threaded applications should lock the data set before setting the data.
        Returns:
        itself (fluent interface)
      • unlock

        DataSet unlock()
        Unlock the data set.
        Returns:
        itself (fluent interface)
      • setAutoNotifaction

        DataSet setAutoNotifaction​(boolean flag)
        Set the automatic notification of invalidation listeners. In general, data sets should notify registered invalidation listeners, if the data in the data set has changed. Charts usually register an invalidation listener with the data set to be notified of any changes and update the charts. Setting the automatic notification to false, allows applications to prevent this behaviour, in case data sets are updated multiple times during an acquisition cycle but the chart update is only required at the end of the cycle.
        Parameters:
        flag - true for automatic notification
        Returns:
        itself (fluent interface)
      • isAutoNotification

        boolean isAutoNotification()
        Checks it automatic notification is enabled.
        Returns:
        true if automatic notification is enabled
      • getDataCount

        int getDataCount()
        Get the number of data points in the data set
        Returns:
        the number of data points
      • getDataCount

        int getDataCount​(double xmin,
                         double xmax)
        Gets the number of data points in the range xmin to xmax.
        Parameters:
        xmin - the lower end of the range
        xmax - the upper end of the range
        Returns:
        the number of data points
      • getX

        double getX​(int i)
        Gets the x value of the data point with the index i
        Parameters:
        i - the index of the data point
        Returns:
        the x value
      • getY

        double getY​(int i)
        Gets the y value of the data point with the index i
        Parameters:
        i - the index of the data point
        Returns:
        the y value
      • getXValues

        default double[] getXValues()
        Returns:
        the x value array
      • getYValues

        default double[] getYValues()
        Returns:
        the y value array
      • getValue

        default double getValue​(double x)
        Gets the interpolated y value of the data point for given x coordinate
        Parameters:
        x - the new x coordinate
        Returns:
        the y value
      • getUndefValue

        java.lang.Double getUndefValue()
        Returns the value for undefined data points.
        Returns:
        the value indicating undefined data points
      • getXIndex

        int getXIndex​(double x)
        Gets the index of the data point closest to the given x coordinate. The index returned may be less then zero or larger the the number of data points in the data set, if the x coordinate lies outside the range of the data set.
        Parameters:
        x - the x position of the data point
        Returns:
        the index of the data point
      • getYIndex

        int getYIndex​(double y)
        Gets the first index of the data point closest to the given y coordinate.
        Parameters:
        y - the y position of the data point
        Returns:
        the index of the data point
      • getXMin

        double getXMin()
        Gets the minimum x value of the data set.
        Returns:
        minimum x value
      • getXMax

        double getXMax()
        Gets the maximum x value of the data set.
        Returns:
        maximum x value
      • getYMin

        double getYMin()
        Gets the minimum y value of the data set.
        Returns:
        minimum y value
      • getYMax

        double getYMax()
        Gets the maximum y value of the data set.
        Returns:
        maximum y value
      • getDataLabel

        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.
        Parameters:
        index - the data index
        Returns:
        label of a data point specified by the index or null if none label has been specified for this data point.
      • getStyle

        java.lang.String getStyle()
        A string representation of the CSS style associated with this specific DataSet. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.
        Returns:
        user-specific data set style description (ie. may be set by user)
      • getStyle

        java.lang.String getStyle​(int index)
        A string representation of the CSS style associated with this specific DataSet data point. @see #getStyle()
        Parameters:
        index - the index of the specific data point
        Returns:
        user-specific data set style description (ie. may be set by user)
      • setStyle

        DataSet setStyle​(java.lang.String style)
        A string representation of the CSS style associated with this specific DataSet. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.
        Parameters:
        style - the new user-specific style
        Returns:
        itself (fluent interface)