com.jrefinery.data
Class XYSeriesCollection

java.lang.Object
  extended by com.jrefinery.data.AbstractDataset
      extended by com.jrefinery.data.AbstractSeriesDataset
          extended by com.jrefinery.data.XYSeriesCollection
All Implemented Interfaces:
Dataset, SeriesChangeListener, SeriesDataset, XYDataset

public class XYSeriesCollection
extends AbstractSeriesDataset
implements XYDataset

Represents a collection of time series that can be used as a dataset.


Field Summary
protected  java.util.List data
          The series that are included in the collection.
 
Fields inherited from class com.jrefinery.data.AbstractDataset
listeners
 
Constructor Summary
XYSeriesCollection()
          Constructs an empty dataset.
XYSeriesCollection(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.
 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 item)
          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.
 
Methods inherited from class com.jrefinery.data.AbstractSeriesDataset
getLegendItemCount, getLegendItemLabels, seriesChanged
 
Methods inherited from class com.jrefinery.data.AbstractDataset
addChangeListener, fireDatasetChanged, notifyListeners, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jrefinery.data.Dataset
addChangeListener, removeChangeListener
 

Field Detail

data

protected java.util.List data
The series that are included in the collection.

Constructor Detail

XYSeriesCollection

public XYSeriesCollection()
Constructs an empty dataset.


XYSeriesCollection

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

Parameters:
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.

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.

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 within a 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 an item within a series.

getYValue

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

Specified by:
getYValue in interface XYDataset
Parameters:
series - The series (zero-based index).
itemIndex - The index of the item of interest (zero-based).
Returns:
The y-value for an item within a series.

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


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.