Package org.jfree.data.xy
Class VectorSeriesCollection
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.general.AbstractSeriesDataset
-
- org.jfree.data.xy.AbstractXYDataset
-
- org.jfree.data.xy.VectorSeriesCollection
-
- All Implemented Interfaces:
java.io.ObjectInputValidation,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,PublicCloneable,Dataset,SeriesChangeListener,SeriesDataset,VectorXYDataset,XYDataset
public class VectorSeriesCollection extends AbstractXYDataset implements VectorXYDataset, PublicCloneable, java.io.Serializable
A collection ofVectorSeriesobjects.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ListdataStorage for the data series.
-
Constructor Summary
Constructors Constructor Description VectorSeriesCollection()Creates a newVectorSeriesCollectioninstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSeries(VectorSeries series)Adds a series to the collection and sends aDatasetChangeEventto all registered listeners.java.lang.Objectclone()Returns a clone of this instance.booleanequals(java.lang.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.java.lang.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.java.lang.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.java.lang.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 aDatasetChangeEventto all registered listeners.booleanremoveSeries(VectorSeries 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, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Methods inherited from interface org.jfree.data.general.SeriesDataset
indexOf
-
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder
-
-
-
-
Method Detail
-
addSeries
public void addSeries(VectorSeries series)
Adds a series to the collection and sends aDatasetChangeEventto all registered listeners.- Parameters:
series- the series (nullnot permitted).
-
removeSeries
public boolean removeSeries(VectorSeries 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- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The series count.
-
getSeries
public VectorSeries getSeries(int series)
Returns a series from the collection.- Parameters:
series- the series index (zero-based).- Returns:
- The series.
- Throws:
java.lang.IllegalArgumentException- ifseriesis not in the range0togetSeriesCount() - 1.
-
getSeriesKey
public java.lang.Comparable getSeriesKey(int series)
Returns the key for a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).- Returns:
- The key for a series.
- Throws:
java.lang.IllegalArgumentException- ifseriesis not in the specified range.
-
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 (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- Parameters:
series- the series (zero-based index).- Returns:
- The item count.
- Throws:
java.lang.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- Overrides:
getXValuein classAbstractXYDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The x-value.
-
getX
public java.lang.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.
-
getYValue
public double getYValue(int series, int item)Returns the y-value for an item within a series.- Specified by:
getYValuein interfaceXYDataset- Overrides:
getYValuein classAbstractXYDataset- Parameters:
series- the series index.item- the item index.- Returns:
- The y-value.
-
getY
public java.lang.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.
-
getVector
public Vector getVector(int series, int item)
Returns the vector for an item in a series.- Specified by:
getVectorin interfaceVectorXYDataset- 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- 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- Parameters:
series- the series index.item- the item index.- Returns:
- The y-component of the vector.
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this instance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if there is a problem.
-
-