public class

TimeTableXYDataset

extends AbstractIntervalXYDataset
implements Cloneable DomainInfo IntervalXYDataset TableXYDataset
java.lang.Object
   ↳ org.jfree.data.general.AbstractDataset
     ↳ org.jfree.data.general.AbstractSeriesDataset
       ↳ org.jfree.data.xy.AbstractXYDataset
         ↳ org.jfree.data.xy.AbstractIntervalXYDataset
           ↳ org.jfree.data.time.TimeTableXYDataset

Class Overview

A dataset for regular time periods that implements the TableXYDataset interface. Note that the TableXYDataset interface requires all series to share the same set of x-values. When adding a new item (x, y) to one series, all other series automatically get a new item (x, null) unless a non-null item has already been specified.

See Also

Summary

Public Constructors
TimeTableXYDataset()
Creates a new dataset.
TimeTableXYDataset(TimeZone zone)
Creates a new dataset with the given time zone.
TimeTableXYDataset(TimeZone zone, Locale locale)
Creates a new dataset with the given time zone and locale.
Public Methods
void add(TimePeriod period, Number y, String seriesName, boolean notify)
Adds a new data item to the dataset and, if requested, sends a DatasetChangeEvent to all registered listeners.
void add(TimePeriod period, double y, String seriesName)
Adds a new data item to the dataset and sends a DatasetChangeEvent to all registered listeners.
void clear()
Removes all data items from the dataset and sends a DatasetChangeEvent to all registered listeners.
Object clone()
Returns a clone of this dataset.
boolean equals(Object obj)
Tests this dataset for equality with an arbitrary object.
Range getDomainBounds(boolean includeInterval)
Returns the range of the values in this dataset's domain.
boolean getDomainIsPointsInTime()
Returns a flag that controls whether the domain is treated as 'points in time'.
double getDomainLowerBound(boolean includeInterval)
Returns the minimum x-value in the dataset.
double getDomainUpperBound(boolean includeInterval)
Returns the maximum x-value in the dataset.
Number getEndX(int series, int item)
Returns the ending X value for the specified series and item.
double getEndXValue(int series, int item)
Returns the end x-value (as a double primitive) for an item within a series.
Number getEndY(int series, int item)
Returns the ending Y value for the specified series and item.
int getItemCount(int series)
Returns the number of items in a series.
int getItemCount()
Returns the number of items in ALL series.
int getSeriesCount()
Returns the number of series in the dataset.
Comparable getSeriesKey(int series)
Returns the key for a series.
Number getStartX(int series, int item)
Returns the starting X value for the specified series and item.
double getStartXValue(int series, int item)
Returns the start x-value (as a double primitive) for an item within a series.
Number getStartY(int series, int item)
Returns the starting Y value for the specified series and item.
TimePeriod getTimePeriod(int item)
Returns the time period for the specified item.
Number getX(int series, int item)
Returns the x-value for an item within a series.
TimePeriodAnchor getXPosition()
Returns the position within each time period that is used for the X value.
double getXValue(int series, int item)
Returns the x-value (as a double primitive) for an item within a series.
Number getY(int series, int item)
Returns the y-value for an item within a series.
void remove(TimePeriod period, String seriesName)
Removes an existing data item from the dataset.
void remove(TimePeriod period, String seriesName, boolean notify)
Removes an existing data item from the dataset and, if requested, sends a DatasetChangeEvent to all registered listeners.
void setDomainIsPointsInTime(boolean flag)
Sets a flag that controls whether the domain is treated as 'points in time', or time periods.
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.
[Expand]
Inherited Methods
From class org.jfree.data.xy.AbstractIntervalXYDataset
From class org.jfree.data.xy.AbstractXYDataset
From class org.jfree.data.general.AbstractSeriesDataset
From class org.jfree.data.general.AbstractDataset
From class java.lang.Object
From interface java.io.ObjectInputValidation
From interface org.jfree.data.DomainInfo
From interface org.jfree.data.general.Dataset
From interface org.jfree.data.general.SeriesChangeListener
From interface org.jfree.data.general.SeriesDataset
From interface org.jfree.data.xy.IntervalXYDataset
From interface org.jfree.data.xy.TableXYDataset
From interface org.jfree.data.xy.XYDataset

Public Constructors

public TimeTableXYDataset ()

Creates a new dataset.

public TimeTableXYDataset (TimeZone zone)

Creates a new dataset with the given time zone.

Parameters
zone the time zone to use (null not permitted).

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).

Public Methods

public void add (TimePeriod period, Number y, String 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.

public void add (TimePeriod period, double y, String seriesName)

Adds a new data item to the dataset and sends a DatasetChangeEvent to all registered listeners.

Parameters
period the time period.
y the value for this period.
seriesName the name of the series to add the value.

public void clear ()

Removes all data items from the dataset and sends a DatasetChangeEvent to all registered listeners.

public Object clone ()

Returns a clone of this dataset.

Returns
  • A clone.
Throws
CloneNotSupportedException if the dataset cannot be cloned.

public boolean equals (Object obj)

Tests this dataset for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public Range getDomainBounds (boolean includeInterval)

Returns the range of the values in this dataset's domain.

Parameters
includeInterval a flag that controls whether or not the x-intervals are taken into account.
Returns
  • The range.

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.

public double getDomainLowerBound (boolean includeInterval)

Returns the minimum x-value in the dataset.

Parameters
includeInterval a flag that determines whether or not the x-interval is taken into account.
Returns
  • The minimum value.

public double getDomainUpperBound (boolean includeInterval)

Returns the maximum x-value in the dataset.

Parameters
includeInterval a flag that determines whether or not the x-interval is taken into account.
Returns
  • The maximum value.

public Number getEndX (int series, int item)

Returns the ending X value for the specified series and item.

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.

public double getEndXValue (int series, int item)

Returns the end x-value (as a double primitive) for an item within a series.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The value.

public Number getEndY (int series, int item)

Returns the ending Y value for the specified series and item.

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.

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).

Parameters
series the series (zero-based index, ignored).
Returns
  • The number of items within the series.

public int getItemCount ()

Returns the number of items in ALL series.

Returns
  • The item count.

public int getSeriesCount ()

Returns the number of series in the dataset.

Returns
  • The series count.

public Comparable getSeriesKey (int series)

Returns the key for a series.

Parameters
series the series (zero-based index).
Returns
  • The key for the series.

public Number getStartX (int series, int item)

Returns the starting X value for the specified series and item.

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.

public double getStartXValue (int series, int item)

Returns the start x-value (as a double primitive) for an item within a series.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The value.

public Number getStartY (int series, int item)

Returns the starting Y value for the specified series and item.

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.

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.

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.

Parameters
series the series (zero-based index).
item the item (zero-based index).
Returns
  • The x-value.

public TimePeriodAnchor getXPosition ()

Returns the position within each time period that is used for the X value.

Returns
  • The anchor position (never null).

public double getXValue (int series, int item)

Returns the x-value (as a double primitive) for an item within a series.

Parameters
series the series index (zero-based).
item the item index (zero-based).
Returns
  • The value.

public Number getY (int series, int item)

Returns the y-value for an item within a series.

Parameters
series the series (zero-based index).
item the item (zero-based index).
Returns
  • The y-value (possibly null).

public void remove (TimePeriod period, String 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).

public void remove (TimePeriod period, String 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.

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.

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