org.jfree.data.xy

Class VectorSeriesCollection

public class VectorSeriesCollection extends AbstractXYDataset implements VectorXYDataset, PublicCloneable, Serializable

A collection of VectorSeries objects.

Since: 1.0.6

Constructor Summary
VectorSeriesCollection()
Creates a new instance of VectorSeriesCollection.
Method Summary
voidaddSeries(VectorSeries series)
Adds a series to the collection and sends a DatasetChangeEvent to all registered listeners.
Objectclone()
Returns a clone of this instance.
booleanequals(Object obj)
Tests this instance for equality with an arbitrary object.
intgetItemCount(int series)
Returns the number of items in the specified series.
VectorSeriesgetSeries(int series)
Returns a series from the collection.
intgetSeriesCount()
Returns the number of series in the collection.
ComparablegetSeriesKey(int series)
Returns the key for a series.
VectorgetVector(int series, int item)
Returns the vector for an item in a series.
doublegetVectorXValue(int series, int item)
Returns the x-component of the vector for an item in a series.
doublegetVectorYValue(int series, int item)
Returns the y-component of the vector for an item in a series.
NumbergetX(int series, int item)
Returns the x-value for an item within a series.
doublegetXValue(int series, int item)
Returns the x-value for an item within a series.
NumbergetY(int series, int item)
Returns the y-value for an item within a series.
doublegetYValue(int series, int item)
Returns the y-value for an item within a series.
intindexOf(VectorSeries series)
Returns the index of the specified series, or -1 if that series is not present in the dataset.
voidremoveAllSeries()
Removes all the series from the collection and sends a DatasetChangeEvent to all registered listeners.
booleanremoveSeries(VectorSeries series)
Removes the specified series from the collection and sends a DatasetChangeEvent to all registered listeners.

Constructor Detail

VectorSeriesCollection

public VectorSeriesCollection()
Creates a new instance of VectorSeriesCollection.

Method Detail

addSeries

public void addSeries(VectorSeries series)
Adds a series to the collection and sends a DatasetChangeEvent to all registered listeners.

Parameters: series the series (null not permitted).

clone

public Object clone()
Returns a clone of this instance.

Returns: A clone.

Throws: CloneNotSupportedException if there is a problem.

equals

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

Parameters: obj the object (null permitted).

Returns: A boolean.

getItemCount

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

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

Returns: The item count.

Throws: IllegalArgumentException if series is not in the range 0 to getSeriesCount() - 1.

getSeries

public VectorSeries getSeries(int series)
Returns a series from the collection.

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

Returns: The series.

Throws: IllegalArgumentException if series is not in the range 0 to getSeriesCount() - 1.

getSeriesCount

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

Returns: The series count.

getSeriesKey

public Comparable getSeriesKey(int series)
Returns the key for a series.

Parameters: series the series index (in the range 0 to getSeriesCount() - 1).

Returns: The key for a series.

Throws: IllegalArgumentException if series is not in the specified range.

getVector

public Vector getVector(int series, int item)
Returns the vector for an item in a series.

Parameters: series the series index. item the item index.

Returns: The vector (possibly null).

getVectorXValue

public double getVectorXValue(int series, int item)
Returns the x-component of the vector for an item in a series.

Parameters: series the series index. item the item index.

Returns: The x-component of the vector.

getVectorYValue

public double getVectorYValue(int series, int item)
Returns the y-component of the vector for an item in a series.

Parameters: series the series index. item the item index.

Returns: The y-component of the vector.

getX

public Number getX(int series, int item)
Returns the x-value for an item within a series. Note that this method creates a new Double instance every time it is called---use VectorSeriesCollection instead, if possible.

Parameters: series the series index. item the item index.

Returns: The x-value.

getXValue

public double getXValue(int series, int item)
Returns the x-value for an item within a series.

Parameters: series the series index. item the item index.

Returns: The x-value.

getY

public Number getY(int series, int item)
Returns the y-value for an item within a series. Note that this method creates a new Double instance every time it is called---use VectorSeriesCollection instead, if possible.

Parameters: series the series index. item the item index.

Returns: The y-value.

getYValue

public double getYValue(int series, int item)
Returns the y-value for an item within a series.

Parameters: series the series index. item the item index.

Returns: The y-value.

indexOf

public int indexOf(VectorSeries series)
Returns the index of the specified series, or -1 if that series is not present in the dataset.

Parameters: series the series (null not permitted).

Returns: The series index.

removeAllSeries

public void removeAllSeries()
Removes all the series from the collection and sends a DatasetChangeEvent to all registered listeners.

removeSeries

public boolean removeSeries(VectorSeries series)
Removes the specified series from the collection and sends a DatasetChangeEvent to all registered listeners.

Parameters: series the series (null not permitted).

Returns: A boolean indicating whether the series has actually been removed.