org.jfree.data
Class DefaultTableXYDataset

java.lang.Object
  extended byorg.jfree.data.AbstractDataset
      extended byorg.jfree.data.AbstractSeriesDataset
          extended byorg.jfree.data.DefaultTableXYDataset
All Implemented Interfaces:
java.lang.Cloneable, Dataset, java.util.EventListener, java.io.ObjectInputValidation, java.io.Serializable, SeriesChangeListener, SeriesDataset, TableXYDataset, XYDataset

public class DefaultTableXYDataset
extends AbstractSeriesDataset
implements TableXYDataset

An XYDataset where every series shares the same x-values (required for generating stacked area charts).

Author:
Richard Atkinson
See Also:
Serialized Form

Constructor Summary
DefaultTableXYDataset()
          Creates a new empty dataset.
DefaultTableXYDataset(XYSeries series)
          Constructs a dataset and populates it with a single time series.
 
Method Summary
 void addSeries(XYSeries series)
          Adds a series to the collection.
 boolean equals(java.lang.Object obj)
          Tests this collection for equality with an arbitrary object.
 int getItemCount()
          Returns the number of X points in the Dataset.
 int getItemCount(int series)
          Returns the number of items in the specified series.
 XYSeries getSeries(int series)
          Returns a series.
 int getSeriesCount()
          Returns the number of series in the collection.
 java.lang.String getSeriesName(int series)
          Returns the name of a series.
 java.lang.Number getXValue(int series, int item)
          Returns the x-value for the specified series and item.
 java.lang.Number getYValue(int series, int index)
          Returns the y-value for the specified series and item.
 void removeAllSeries()
          Removes all the series from the collection.
 void removeSeries(int series)
          Removes a series from the collection.
 void removeSeries(XYSeries series)
          Removes a series from the collection.
 void seriesChanged(SeriesChangeEvent event)
          Called when a series belonging to the dataset changes.
 void updateXPoints()
          Updates XPoints for all series.
 
Methods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, notifyListeners, removeChangeListener, setGroup, validateObject
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Constructor Detail

DefaultTableXYDataset

public DefaultTableXYDataset()
Creates a new empty dataset.


DefaultTableXYDataset

public DefaultTableXYDataset(XYSeries series)
Constructs a dataset and populates it with a single time series.

Parameters:
series - the time series.
Method Detail

addSeries

public void addSeries(XYSeries series)
Adds a series to the collection.

Notifies all registered listeners that the dataset has changed.

Parameters:
series - the series.

updateXPoints

public void updateXPoints()
Updates XPoints for all series.


getSeriesCount

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

Specified by:
getSeriesCount in interface SeriesDataset
Specified by:
getSeriesCount in class AbstractSeriesDataset
Returns:
the number of series in the collection.

getItemCount

public int getItemCount()
Returns the number of X points in the Dataset.

Specified by:
getItemCount in interface TableXYDataset
Returns:
the number of X points in the Dataset

getSeries

public XYSeries getSeries(int series)
Returns a series.

Parameters:
series - the series (zero-based index).
Returns:
The series.

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 a series.

getItemCount

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

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

getXValue

public java.lang.Number getXValue(int series,
                                  int item)
Returns the x-value for the specified series and item.

Specified by:
getXValue in interface XYDataset
Parameters:
series - the series (zero-based index).
item - the item (zero-based index).
Returns:
the x-value for the specified series and item.

getYValue

public java.lang.Number getYValue(int series,
                                  int index)
Returns the y-value for the specified series and item.

Specified by:
getYValue in interface XYDataset
Parameters:
series - the series (zero-based index).
index - the index of the item of interest (zero-based).
Returns:
the y-value for the specified series and item.

removeAllSeries

public void removeAllSeries()
Removes all the series from the collection.

Notifies all registered listeners that the dataset has changed.


removeSeries

public void removeSeries(XYSeries series)
Removes a series from the collection.

Notifies all registered listeners that the dataset has changed.

Parameters:
series - the series.

removeSeries

public void removeSeries(int series)
Removes a series from the collection.

Notifies all registered listeners that the dataset has changed.

Parameters:
series - the series (zero based index).

seriesChanged

public void seriesChanged(SeriesChangeEvent event)
Called when a series belonging to the dataset changes.

Specified by:
seriesChanged in interface SeriesChangeListener
Overrides:
seriesChanged in class AbstractSeriesDataset
Parameters:
event - information about the change.

equals

public boolean equals(java.lang.Object obj)
Tests this collection for equality with an arbitrary object.

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