Class AbstractDataSet<D extends AbstractStylable<D>>

    • Constructor Detail

      • AbstractDataSet

        public AbstractDataSet​(java.lang.String name,
                               int dimension)
        default constructor
        Parameters:
        name - the default name of the data set (meta data)
        dimension - dimension of this data set
    • Method Detail

      • 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.
        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()
        Parameters:
        index - the index of the specific data point
        style - string for the data point specific CSS-styling
        Returns:
        itself (fluent interface)
      • autoNotification

        public java.util.concurrent.atomic.AtomicBoolean autoNotification()
        Description copied from interface: EventSource
        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. true for automatic notification
        Specified by:
        autoNotification in interface EventSource
        Returns:
        the atomic boolean
      • binarySearch

        protected int binarySearch​(int dimIndex,
                                   double search,
                                   int indexMin,
                                   int indexMax)
      • clearMetaInfo

        public D clearMetaInfo()
      • equalDataLabels

        protected boolean equalDataLabels​(DataSet other)
        checks for equal data labels, may be overwritten by derived classes
        Parameters:
        other - class
        Returns:
        true if equal
      • equalEditConstraints

        protected boolean equalEditConstraints​(DataSet other)
        checks for equal EditConstraints, may be overwritten by derived classes
        Parameters:
        other - class
        Returns:
        true if equal
      • equalErrorValues

        protected boolean equalErrorValues​(DataSet other,
                                           double epsilon)
        checks for equal 'get' error values, may be overwritten by derived classes
        Parameters:
        other - class
        epsilon - tolerance threshold
        Returns:
        true if equal
      • equalMetaData

        protected boolean equalMetaData​(DataSet other)
        checks for equal meta data, may be overwritten by derived classes
        Parameters:
        other - class
        Returns:
        true if equal
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj,
                              double epsilon)
        Indicates whether some other object is "equal to" this one.
        Parameters:
        obj - the reference object with which to compare.
        epsilon - tolerance parameter (epsilon<=0 corresponds to numerically identical)
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • equalValues

        protected boolean equalValues​(DataSet other,
                                      double epsilon)
        checks for equal 'get' values with tolerance band, may be overwritten by derived classes
        Parameters:
        other - class
        epsilon - tolerance threshold
        Returns:
        true if equal
      • fireInvalidated

        public D fireInvalidated​(UpdateEvent event)
        Notifies listeners that the data has been invalidated. If the data is added to the chart, it triggers repaint.
        Parameters:
        event - the change event
        Returns:
        itself (fluent design)
      • 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
        Parameters:
        index - of the data label
        Returns:
        data point label specified by the index or null if no label has been specified
      • getDataLabelMap

        public StringHashMapList getDataLabelMap()
        Returns:
        data label map for given data point
      • getDataStyleMap

        public StringHashMapList getDataStyleMap()
        Returns:
        data style map (CSS-styling)
      • getDimension

        public final int getDimension()
        Specified by:
        getDimension in interface DataSet
        Returns:
        number of dimensions
      • getMetaInfo

        public java.util.Map<java.lang.String,​java.lang.String> getMetaInfo()
        Specified by:
        getMetaInfo in interface DataSetMetaData
      • getName

        public java.lang.String getName()
        Description copied from interface: DataSet
        Gets the name of the data set.
        Specified by:
        getName in interface DataSet
        Returns:
        the name of the DataSet
      • 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
        Parameters:
        index - the index of the specific data point
        Returns:
        user-specific data set style description (ie. may be set by user)
      • getIndex

        public int getIndex​(int dimIndex,
                            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.
        Specified by:
        getIndex in interface DataSet
        Parameters:
        dimIndex - the dimension index
        x - the x position of the data point#
        Returns:
        the index of the data point
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • minNeigbourSearchX

        protected int minNeigbourSearchX​(double search,
                                         int indexMin,
                                         int indexMax)
      • recomputeLimits

        public D recomputeLimits​(int dimension)
        Computes limits (ranges) of this DataSet.
        Specified by:
        recomputeLimits in interface DataSet
        Parameters:
        dimension - the chosen dimension
        Returns:
        itself (fluent design)
      • 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.
        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()
        Parameters:
        index - the index of the specific data point
        Returns:
        itself (fluent interface)
      • setEditConstraints

        public D setEditConstraints​(EditConstraints constraints)
      • setName

        public D setName​(java.lang.String name)
        Sets the name of data set (meta data)
        Parameters:
        name - the new name
        Returns:
        itself (fluent design)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • updateEventListener

        public java.util.List<EventListener> updateEventListener()
        Specified by:
        updateEventListener in interface EventSource
        Returns:
        list containing all update event listener (needs to be provided by implementing class)