Module org.jfree.chart
Package org.jfree.data.xy
Class VectorSeriesCollection<S extends Comparable<S>>
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.general.AbstractSeriesDataset<S>
-
- org.jfree.data.xy.AbstractXYDataset<S>
-
- org.jfree.data.xy.VectorSeriesCollection<S>
-
- Type Parameters:
S- The type for the series keys.
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,PublicCloneable,Dataset,SeriesChangeListener,SeriesDataset<S>,VectorXYDataset<S>,XYDataset<S>
public class VectorSeriesCollection<S extends Comparable<S>> extends AbstractXYDataset<S> implements VectorXYDataset<S>, PublicCloneable, Serializable
A collection ofVectorSeriesobjects.- Since:
- 1.0.6
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VectorSeriesCollection()Creates a newVectorSeriesCollectioninstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSeries(VectorSeries<S> series)Adds a series to the collection and sends aDatasetChangeEventto 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.VectorSeries<S>getSeries(int series)Returns a series from the collection.intgetSeriesCount()Returns the number of series in the collection.SgetSeriesKey(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<S> 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 aDatasetChangeEventto all registered listeners.booleanremoveSeries(VectorSeries<S> series)Removes the specified series from the collection and sends aDatasetChangeEventto all registered listeners.-
Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder
-
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChanged
-
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, fireDatasetChanged, getNotify, hasListener, notifyListeners, removeChangeListener, setNotify, validateObject
-
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, removeChangeListener
-
Methods inherited from interface org.jfree.data.general.SeriesDataset
indexOf
-
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder
-
-
-
-
Constructor Detail
-
VectorSeriesCollection
public VectorSeriesCollection()
Creates a newVectorSeriesCollectioninstance.
-
-
Method Detail
-
addSeries
public void addSeries(VectorSeries<S> series)
Adds a series to the collection and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (nullnot permitted).
-
removeSeries
public boolean removeSeries(VectorSeries<S> series)
Removes the specified series from the collection and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (nullnot permitted).- Returns:
- A boolean indicating whether the series has actually been removed.
-
removeAllSeries
public void removeAllSeries()
Removes all the series from the collection and sends aDatasetChangeEventto all registered listeners.
-
getSeriesCount
public int getSeriesCount()
Returns the number of series in the collection.- Specified by:
getSeriesCountin interfaceSeriesDataset<S extends Comparable<S>>- Specified by:
getSeriesCountin classAbstractSeriesDataset<S extends Comparable<S>>- Returns:
- The series count.
-
getSeries
public VectorSeries<S> getSeries(int series)
Returns a series from the collection.- Parameters:
series- the series index (zero-based).- Returns:
- The series.
- Throws:
IllegalArgumentException- ifseriesis not in the range0togetSeriesCount() - 1.
-
getSeriesKey
public S getSeriesKey(int series)
Returns the key for a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset<S extends Comparable<S>>- Specified by:
getSeriesKeyin classAbstractSeriesDataset<S extends Comparable<S>>- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).- Returns:
- The key for a series.
- Throws:
IllegalArgumentException- ifseriesis not in the specified range.
-
indexOf
public int indexOf(VectorSeries<S> series)
Returns the index of the specified series, or -1 if that series is not present in the dataset.- Parameters:
series- the series (nullnot permitted).- Returns:
- The series index.
-
getItemCount
public int getItemCount(int series)
Returns the number of items in the specified series.- Specified by:
getItemCountin interfaceXYDataset<S extends Comparable<S>>- Parameters:
series- the series (zero-based index).- Returns:
- The item count.
- Throws:
IllegalArgumentException- ifseriesis not in the range0togetSeriesCount() - 1.
-
getXValue
public double getXValue(int series, int item)
Returns the x-value for an item within a series.- Specified by:
getXValuein interfaceXYDataset<S extends Comparable<S>>- Overrides:
getXValuein classAbstractXYDataset<S extends Comparable<S>>- Parameters:
series- the series index.item- the item index.- Returns:
- The x-value.
-
getX
public Number getX(int series, int item)
Returns the x-value for an item within a series. Note that this method creates a newDoubleinstance every time it is called---usegetXValue(int, int)instead, if possible.- Specified by:
getXin interfaceXYDataset<S extends Comparable<S>>- Parameters:
series- the series index.item- the item index.- Returns:
- The x-value.
-
getYValue
public double getYValue(int series, int item)
Returns the y-value for an item within a series.- Specified by:
getYValuein interfaceXYDataset<S extends Comparable<S>>- Overrides:
getYValuein classAbstractXYDataset<S extends Comparable<S>>- Parameters:
series- the series index.item- the item index.- Returns:
- The y-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 newDoubleinstance every time it is called---usegetYValue(int, int)instead, if possible.- Specified by:
getYin interfaceXYDataset<S extends Comparable<S>>- Parameters:
series- the series index.item- the item index.- Returns:
- The y-value.
-
getVector
public Vector getVector(int series, int item)
Returns the vector for an item in a series.- Specified by:
getVectorin interfaceVectorXYDataset<S extends Comparable<S>>- 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.- Specified by:
getVectorXValuein interfaceVectorXYDataset<S extends Comparable<S>>- 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.- Specified by:
getVectorYValuein interfaceVectorXYDataset<S extends Comparable<S>>- Parameters:
series- the series index.item- the item index.- Returns:
- The y-component of the vector.
-
equals
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of this instance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a problem.
-
-