DynamicTimeSeriesCollection
org.jfree.data.time

Class DynamicTimeSeriesCollection

    • Field Detail

      • START

        public static final int START
        Useful constant for controlling the x-value returned for a time period.
        See Also:
        Constant Field Values
      • MIDDLE

        public static final int MIDDLE
        Useful constant for controlling the x-value returned for a time period.
        See Also:
        Constant Field Values
      • END

        public static final int END
        Useful constant for controlling the x-value returned for a time period.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DynamicTimeSeriesCollection

        public DynamicTimeSeriesCollection(int nSeries,                           int nMoments)
        Constructs a dataset with capacity for N series, tied to default timezone.
        Parameters:
        nSeries - the number of series to be accommodated.
        nMoments - the number of TimePeriods to be spanned.
      • DynamicTimeSeriesCollection

        public DynamicTimeSeriesCollection(int nSeries,                           int nMoments,                           TimeZone zone)
        Constructs an empty dataset, tied to a specific timezone.
        Parameters:
        nSeries - the number of series to be accommodated
        nMoments - the number of TimePeriods to be spanned
        zone - the timezone.
      • DynamicTimeSeriesCollection

        public DynamicTimeSeriesCollection(int nSeries,                           int nMoments,                           RegularTimePeriod timeSample)
        Creates a new dataset.
        Parameters:
        nSeries - the number of series.
        nMoments - the number of items per series.
        timeSample - a time period sample.
      • DynamicTimeSeriesCollection

        public DynamicTimeSeriesCollection(int nSeries,                           int nMoments,                           RegularTimePeriod timeSample,                           TimeZone zone)
        Creates a new dataset.
        Parameters:
        nSeries - the number of series.
        nMoments - the number of items per series.
        timeSample - a time period sample.
        zone - the time zone.
    • Method Detail

      • setTimeBase

        public long setTimeBase(RegularTimePeriod start)
        Fill the pointsInTime with times using TimePeriod.next(): Will silently return if the time array was already populated. Also computes the data cached for later use by methods implementing the DomainInfo interface:
        Parameters:
        start - the start.
        Returns:
        ??.
      • getPosition

        public int getPosition()
        Returns the x position type (START, MIDDLE or END).
        Returns:
        The x position type.
      • setPosition

        public void setPosition(int position)
        Sets the x position type (START, MIDDLE or END).
        Parameters:
        position - The x position type.
      • addSeries

        public void addSeries(float[] values,             int seriesNumber,             Comparable seriesKey)
        Adds a series to the dataset. Only the y-values are supplied, the x-values are specified elsewhere.
        Parameters:
        values - the y-values.
        seriesNumber - the series index (zero-based).
        seriesKey - the series key. Use this as-is during setup only, or add the synchronized keyword around the copy loop.
      • setSeriesKey

        public void setSeriesKey(int seriesNumber,                Comparable key)
        Sets the name of a series. If planning to add values individually.
        Parameters:
        seriesNumber - the series.
        key - the new key.
      • addValue

        public void addValue(int seriesNumber,            int index,            float value)
        Adds a value to a series.
        Parameters:
        seriesNumber - the series index.
        index - ??.
        value - the value.
      • getItemCount

        public int getItemCount(int series)
        Returns the number of items in a series.

        For this implementation, all series have the same number of items.

        Specified by:
        getItemCount in interface XYDataset
        Parameters:
        series - the series index (zero-based).
        Returns:
        The item count.
      • offsetFromNewest

        public int offsetFromNewest(int delta)
        Returns the actual index to a time offset by "delta" from newestAt.
        Parameters:
        delta - the delta.
        Returns:
        The offset.
      • offsetFromOldest

        public int offsetFromOldest(int delta)
        ??
        Parameters:
        delta - ??
        Returns:
        The offset.
      • advanceTime

        public RegularTimePeriod advanceTime()
        Adjust the array offset as needed when a new time-period is added: Increments the indices "oldestAt" and "newestAt", mod(array length), zeroes the series values at newestAt, returns the new TimePeriod.
        Returns:
        The new time period.
      • invalidateRangeInfo

        public void invalidateRangeInfo()
        Invalidates the range info.
      • getOldestIndex

        public int getOldestIndex()
        Returns the index of the oldest data item.
        Returns:
        The index.
      • getNewestIndex

        public int getNewestIndex()
        Returns the index of the newest data item.
        Returns:
        The index.
      • appendData

        public void appendData(float[] newData)
        Appends new data.
        Parameters:
        newData - the data.
      • appendData

        public void appendData(float[] newData,              int insertionIndex,              int refresh)
        Appends data at specified index, for loading up with data from file(s).
        Parameters:
        newData - the data
        insertionIndex - the index value at which to put it
        refresh - value of n in "refresh the display on every nth call" (ignored if <= 0 )
      • getNewestTime

        public RegularTimePeriod getNewestTime()
        Returns the newest time.
        Returns:
        The newest time.
      • getOldestTime

        public RegularTimePeriod getOldestTime()
        Returns the oldest time.
        Returns:
        The oldest time.
      • getX

        public Number getX(int series,          int item)
        Returns the x-value.
        Specified by:
        getX in interface XYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getYValue

        public double getYValue(int series,               int item)
        Returns the y-value.
        Specified by:
        getYValue in interface XYDataset
        Overrides:
        getYValue in class AbstractXYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getY

        public Number getY(int series,          int item)
        Returns the y-value.
        Specified by:
        getY in interface XYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getStartX

        public Number getStartX(int series,               int item)
        Returns the start x-value.
        Specified by:
        getStartX in interface IntervalXYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getEndX

        public Number getEndX(int series,             int item)
        Returns the end x-value.
        Specified by:
        getEndX in interface IntervalXYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getStartY

        public Number getStartY(int series,               int item)
        Returns the start y-value.
        Specified by:
        getStartY in interface IntervalXYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getEndY

        public Number getEndY(int series,             int item)
        Returns the end y-value.
        Specified by:
        getEndY in interface IntervalXYDataset
        Parameters:
        series - the series index (zero-based).
        item - the item index (zero-based).
        Returns:
        The value.
      • getDomainLowerBound

        public double getDomainLowerBound(boolean includeInterval)
        Returns the minimum x-value in the dataset.
        Specified by:
        getDomainLowerBound in interface DomainInfo
        Parameters:
        includeInterval - a flag that determines whether or not the x-interval is taken into account.
        Returns:
        The minimum value.
      • getDomainUpperBound

        public double getDomainUpperBound(boolean includeInterval)
        Returns the maximum x-value in the dataset.
        Specified by:
        getDomainUpperBound in interface DomainInfo
        Parameters:
        includeInterval - a flag that determines whether or not the x-interval is taken into account.
        Returns:
        The maximum value.
      • getDomainBounds

        public Range getDomainBounds(boolean includeInterval)
        Returns the range of the values in this dataset's domain.
        Specified by:
        getDomainBounds in interface DomainInfo
        Parameters:
        includeInterval - a flag that determines whether or not the x-interval is taken into account.
        Returns:
        The range.
      • getRangeLowerBound

        public double getRangeLowerBound(boolean includeInterval)
        Returns the minimum range value.
        Specified by:
        getRangeLowerBound in interface RangeInfo
        Parameters:
        includeInterval - a flag that determines whether or not the y-interval is taken into account.
        Returns:
        The minimum range value.
      • getRangeUpperBound

        public double getRangeUpperBound(boolean includeInterval)
        Returns the maximum range value.
        Specified by:
        getRangeUpperBound in interface RangeInfo
        Parameters:
        includeInterval - a flag that determines whether or not the y-interval is taken into account.
        Returns:
        The maximum range value.
      • getRangeBounds

        public Range getRangeBounds(boolean includeInterval)
        Returns the value range.
        Specified by:
        getRangeBounds in interface RangeInfo
        Parameters:
        includeInterval - a flag that determines whether or not the y-interval is taken into account.
        Returns:
        The range.

SCaVis 1.7 © jWork.org