org.jfree.data.time
Class TimeTableXYDataset

java.lang.Object
  extended byorg.jfree.data.general.AbstractDataset
      extended byorg.jfree.data.general.AbstractSeriesDataset
          extended byorg.jfree.data.xy.AbstractXYDataset
              extended byorg.jfree.data.xy.AbstractIntervalXYDataset
                  extended byorg.jfree.data.time.TimeTableXYDataset
All Implemented Interfaces:
java.lang.Cloneable, Dataset, DomainInfo, java.util.EventListener, IntervalXYDataset, java.io.ObjectInputValidation, java.io.Serializable, SeriesChangeListener, SeriesDataset, TableXYDataset, XYDataset

public class TimeTableXYDataset
extends AbstractIntervalXYDataset
implements IntervalXYDataset, DomainInfo, TableXYDataset

A dataset for regular time periods that implements the TableXYDataset interface.

Author:
andreas.schroeder
See Also:
TableXYDataset, Serialized Form

Constructor Summary
TimeTableXYDataset()
          Creates a new TimeTableDataset.
TimeTableXYDataset(java.util.TimeZone zone)
          Creates a new TimeTableDataset with the given time zone.
TimeTableXYDataset(java.util.TimeZone zone, java.util.Locale locale)
          Creates a new TimeTableDataset with the given time zone and locale.
 
Method Summary
 void add(RegularTimePeriod period, double y, java.lang.String seriesName)
          Adds a new data item to the dataset.
 void add(RegularTimePeriod period, java.lang.Number y, java.lang.String seriesName, boolean notify)
          Adds a new data item to the dataset.
 boolean getDomainIsPointsInTime()
          Returns a flag that controls whether the domain is treated as 'points in time'.
 Range getDomainRange()
          Returns the range of the values in this dataset's domain.
 java.lang.Number getEndX(int series, int item)
          Returns the ending X value for the specified series and item.
 java.lang.Number getEndY(int series, int item)
          Returns the ending Y value for the specified series and item.
 int getItemCount()
          Returns the number of items every series.
 int getItemCount(int series)
          Returns the number of items in a series.
 java.lang.Number getMaximumDomainValue()
          Returns the maximum value in the dataset (or null if all the values in the domain are null).
 java.lang.Number getMinimumDomainValue()
          Returns the minimum value in the dataset (or null if all the values in the domain are null).
 int getSeriesCount()
          Returns the number of series in the dataset.
 java.lang.String getSeriesName(int series)
          Returns the name of a series.
 java.lang.Number getStartX(int series, int item)
          Returns the starting X value for the specified series and item.
 java.lang.Number getStartY(int series, int item)
          Returns the starting Y value for the specified series and item.
 java.lang.Number getX(int series, int item)
          Returns the x-value for an item within a series.
 java.lang.Number getY(int series, int item)
          Returns the y-value for an item within a series.
 void remove(RegularTimePeriod period, java.lang.String seriesName)
          Removes an existing data item from the dataset.
 void remove(RegularTimePeriod period, java.lang.String seriesName, boolean notify)
          Removes an existing data item from the dataset.
 void setDomainIsPointsInTime(boolean flag)
          Sets a flag that controls whether the domain is treated as 'points in time', or time periods.
 
Methods inherited from class org.jfree.data.xy.AbstractIntervalXYDataset
getEndXValue, getEndYValue, getStartXValue, getStartYValue
 
Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder, getXValue, getYValue
 
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
seriesChanged
 
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.xy.IntervalXYDataset
getEndXValue, getEndYValue, getStartXValue, getStartYValue
 
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder, getXValue, getYValue
 
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Constructor Detail

TimeTableXYDataset

public TimeTableXYDataset()
Creates a new TimeTableDataset.


TimeTableXYDataset

public TimeTableXYDataset(java.util.TimeZone zone)
Creates a new TimeTableDataset with the given time zone.

Parameters:
zone - the time zone to use.

TimeTableXYDataset

public TimeTableXYDataset(java.util.TimeZone zone,
                          java.util.Locale locale)
Creates a new TimeTableDataset with the given time zone and locale.

Parameters:
zone - the time zone to use.
locale - the locale to use.
Method Detail

add

public void add(RegularTimePeriod period,
                double y,
                java.lang.String seriesName)
Adds a new data item to the dataset.

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

add

public void add(RegularTimePeriod period,
                java.lang.Number y,
                java.lang.String seriesName,
                boolean notify)
Adds a new data item to the dataset.

Parameters:
period - the time period.
y - the value for this period.
seriesName - the name of the series to add the value.
notify - wether dataset listener are notified or not.

remove

public void remove(RegularTimePeriod period,
                   java.lang.String seriesName)
Removes an existing data item from the dataset.

Parameters:
period - the (existing!) time period of the value to remove.
seriesName - the (existing!) series name to remove the value.

remove

public void remove(RegularTimePeriod period,
                   java.lang.String seriesName,
                   boolean notify)
Removes an existing data item from the dataset.

Parameters:
period - the (existing!) time period of the value to remove.
seriesName - the (existing!) series name to remove the value.
notify - wether dataset listener are notified or not.

getItemCount

public int getItemCount()
Returns the number of items every 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.

Specified by:
getItemCount in interface XYDataset
Parameters:
series - the series (zero-based index).
Returns:
the number of items within the series.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset.

Specified by:
getSeriesCount in interface SeriesDataset
Specified by:
getSeriesCount in class AbstractSeriesDataset
Returns:
the series count.

getSeriesName

public java.lang.String getSeriesName(int series)
Returns the name of a series.

Specified by:
getSeriesName in interface SeriesDataset
Specified by:
getSeriesName in class AbstractSeriesDataset
Parameters:
series - the series (zero-based index).
Returns:
the name of the series.

getX

public java.lang.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.

getStartX

public java.lang.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.

getEndX

public java.lang.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.

getY

public java.lang.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 java.lang.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:
starting Y value for the specified series and item.

getEndY

public java.lang.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.

getMinimumDomainValue

public java.lang.Number getMinimumDomainValue()
Returns the minimum value in the dataset (or null if all the values in the domain are null).

Specified by:
getMinimumDomainValue in interface DomainInfo
Returns:
The minimum value.

getMaximumDomainValue

public java.lang.Number getMaximumDomainValue()
Returns the maximum value in the dataset (or null if all the values in the domain are null).

Specified by:
getMaximumDomainValue in interface DomainInfo
Returns:
The maximum value.

getDomainRange

public Range getDomainRange()
Returns the range of the values in this dataset's domain.

Specified by:
getDomainRange in interface DomainInfo
Returns:
The range.

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.

setDomainIsPointsInTime

public void setDomainIsPointsInTime(boolean flag)
Sets a flag that controls whether the domain is treated as 'points in time', or time periods.

Parameters:
flag - The new value of the flag.