TimeTableXYDataset
org.jfree.data.time

Class TimeTableXYDataset

    • Constructor Detail

      • TimeTableXYDataset

        public TimeTableXYDataset()
        Creates a new dataset.
      • TimeTableXYDataset

        public TimeTableXYDataset(TimeZone zone)
        Creates a new dataset with the given time zone.
        Parameters:
        zone - the time zone to use (null not permitted).
      • TimeTableXYDataset

        public TimeTableXYDataset(TimeZone zone,                  Locale locale)
        Creates a new dataset with the given time zone and locale.
        Parameters:
        zone - the time zone to use (null not permitted).
        locale - the locale to use (null not permitted).
    • Method Detail

      • getDomainIsPointsInTime

        public boolean getDomainIsPointsInTime()
        Returns a flag that controls whether the domain is treated as 'points in time'.

        This flag is used when determining the max and min values for the domain. If true, then only the x-values are considered for the max and min values. If false, then the start and end x-values will also be taken into consideration.

        Returns:
        The flag.
        See Also:
        setDomainIsPointsInTime(boolean)
      • setDomainIsPointsInTime

        public void setDomainIsPointsInTime(boolean flag)
        Sets a flag that controls whether the domain is treated as 'points in time', or time periods. A DatasetChangeEvent is sent to all registered listeners.
        Parameters:
        flag - the new value of the flag.
        See Also:
        getDomainIsPointsInTime()
      • setXPosition

        public void setXPosition(TimePeriodAnchor anchor)
        Sets the position within each time period that is used for the X values, then sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        anchor - the anchor position (null not permitted).
        See Also:
        getXPosition()
      • add

        public void add(TimePeriod period,       Number y,       Comparable seriesName,       boolean notify)
        Adds a new data item to the dataset and, if requested, sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        period - the time period (null not permitted).
        y - the value for this period (null permitted).
        seriesName - the name of the series to add the value (null not permitted).
        notify - whether dataset listener are notified or not.
        See Also:
        remove(TimePeriod, Comparable, boolean)
      • remove

        public void remove(TimePeriod period,          Comparable seriesName)
        Removes an existing data item from the dataset.
        Parameters:
        period - the (existing!) time period of the value to remove (null not permitted).
        seriesName - the (existing!) series name to remove the value (null not permitted).
        See Also:
        add(TimePeriod, double, Comparable)
      • remove

        public void remove(TimePeriod period,          Comparable seriesName,          boolean notify)
        Removes an existing data item from the dataset and, if requested, sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        period - the (existing!) time period of the value to remove (null not permitted).
        seriesName - the (existing!) series name to remove the value (null not permitted).
        notify - whether dataset listener are notified or not.
        See Also:
        add(TimePeriod, double, Comparable)
      • clear

        public void clear()
        Removes all data items from the dataset and sends a DatasetChangeEvent to all registered listeners.
      • getTimePeriod

        public TimePeriod getTimePeriod(int item)
        Returns the time period for the specified item. Bear in mind that all series share the same set of time periods.
        Parameters:
        item - the item index (0 <= i <= getItemCount()).
        Returns:
        The time period.
      • getItemCount

        public int getItemCount()
        Returns the number of items in ALL series.
        Specified by:
        getItemCount in interface TableXYDataset
        Returns:
        The item count.
      • getItemCount

        public int getItemCount(int series)
        Returns the number of items in a series. This is the same value that is returned by getItemCount() since all series share the same x-values (time periods).
        Specified by:
        getItemCount in interface XYDataset
        Parameters:
        series - the series (zero-based index, ignored).
        Returns:
        The number of items within the series.
      • getX

        public Number getX(int series,          int item)
        Returns the x-value for an item within a series. The x-values may or may not be returned in ascending order, that is up to the class implementing the interface.
        Specified by:
        getX in interface XYDataset
        Parameters:
        series - the series (zero-based index).
        item - the item (zero-based index).
        Returns:
        The x-value.
      • getXValue

        public double getXValue(int series,               int item)
        Returns the x-value (as a double primitive) for an item within a series.
        Specified by:
        getXValue in interface XYDataset
        Overrides:
        getXValue in class AbstractXYDataset
        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 starting X value for the specified series and item.
        Specified by:
        getStartX in interface IntervalXYDataset
        Parameters:
        series - the series (zero-based index).
        item - the item within a series (zero-based index).
        Returns:
        The starting X value for the specified series and item.
        See Also:
        getStartXValue(int, int)
      • getEndX

        public Number getEndX(int series,             int item)
        Returns the ending X value for the specified series and item.
        Specified by:
        getEndX in interface IntervalXYDataset
        Parameters:
        series - the series (zero-based index).
        item - the item within a series (zero-based index).
        Returns:
        The ending X value for the specified series and item.
        See Also:
        getEndXValue(int, int)
      • getY

        public Number getY(int series,          int item)
        Returns the y-value for an item within a series.
        Specified by:
        getY in interface XYDataset
        Parameters:
        series - the series (zero-based index).
        item - the item (zero-based index).
        Returns:
        The y-value (possibly null).
      • getStartY

        public Number getStartY(int series,               int item)
        Returns the starting Y value for the specified series and item.
        Specified by:
        getStartY in interface IntervalXYDataset
        Parameters:
        series - the series (zero-based index).
        item - the item within a series (zero-based index).
        Returns:
        The starting Y value for the specified series and item.
      • getEndY

        public Number getEndY(int series,             int item)
        Returns the ending Y value for the specified series and item.
        Specified by:
        getEndY in interface IntervalXYDataset
        Parameters:
        series - the series (zero-based index).
        item - the item within a series (zero-based index).
        Returns:
        The ending Y value for the specified series and item.
      • 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 controls whether or not the x-intervals are taken into account.
        Returns:
        The range.
      • equals

        public boolean equals(Object obj)
        Tests this dataset for equality with an arbitrary object.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.

SCaVis 2.0 © jWork.ORG