Class AbstractDataProvider

    • Field Detail

      • chronological

        protected boolean chronological
      • xDataMinMax

        protected Range xDataMinMax
      • yDataMinMax

        protected Range yDataMinMax
    • Constructor Detail

      • AbstractDataProvider

        public AbstractDataProvider​(boolean chronological)
        Parameters:
        trace - the trace which the data provider will provide data to.
        chronological - true if the data is sorted chronologically on xAxis, which means the data is sorted on X Axis.
    • Method Detail

      • getSample

        public abstract ISample getSample​(int index)
        Description copied from interface: IDataProvider
        Get sample by index

        Synchronization: Since the data might change dynamically, synchronize on the IDataProvider around calls to getSize() and getSample().

        Specified by:
        getSample in interface IDataProvider
        Parameters:
        index -
        Returns:
        the ISample element at the given index
      • getXDataMinMax

        public Range getXDataMinMax()
        Description copied from interface: IDataProvider
        Get the minimum and maximum xdata.
        Specified by:
        getXDataMinMax in interface IDataProvider
        Returns:
        a range includes the min and max as lower and upper. return null if there is no data.
      • getYDataMinMax

        public Range getYDataMinMax()
        Description copied from interface: IDataProvider
        Get the minimum and maximum ydata.
        Specified by:
        getYDataMinMax in interface IDataProvider
        Returns:
        a range includes the min and max as lower and upper. return null if there is no data.
      • getXDataMinMax

        public Range getXDataMinMax​(boolean positiveOnly)
        Description copied from interface: IDataProvider
        Get the minimum and maximum xdata.
        Specified by:
        getXDataMinMax in interface IDataProvider
        Parameters:
        positiveOnly - if true, return values greater than zero
        Returns:
        a range includes the min and max as lower and upper. return null if there is no data.
      • getYDataMinMax

        public Range getYDataMinMax​(boolean positiveOnly)
        Description copied from interface: IDataProvider
        Get the minimum and maximum ydata.
        Specified by:
        getYDataMinMax in interface IDataProvider
        Parameters:
        positiveOnly - if true, return values greater than zero
        Returns:
        a range includes the min and max as lower and upper. return null if there is no data.
      • getDataRange

        public Range getDataRange​(boolean positiveOnly,
                                  boolean isAxis)
        Returns an updated range whenever data changed, for the XAxis or YAxis, with positive data only or not.
        Parameters:
        positiveOnly - if data is positive only (for log scale mode)
        isXAxis -
        isXAxis - if true, then this will return the updated range for the XAxis, YAxis otherwise
      • getDataRange

        public Range getDataRange​(boolean positiveOnly,
                                  boolean isXAxis,
                                  int lowerBound)
        Returns an updated range whenever data changed, for the XAxis or YAxis, with positive data only or not.
        Parameters:
        positiveOnly - if data is positive only (for log scale mode)
        isXAxis - if true, then this will return the updated range for the XAxis, YAxis otherwise
        lowerBound - by default it should be 0
      • setChronological

        public void setChronological​(boolean chronological)
        Parameters:
        chronological - the chronological to set
      • isChronological

        public boolean isChronological()
        Specified by:
        isChronological in interface IDataProvider
        Returns:
        true if the order is chronological
      • fireDataChange

        protected void fireDataChange()
        a data change has occured