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:
ObjectInputValidation
,Serializable
,Cloneable
,EventListener
,PublicCloneable
,Dataset
,SeriesChangeListener
,SeriesDataset
,VectorXYDataset
,XYDataset
public class VectorSeriesCollection
extends AbstractXYDataset
implements VectorXYDataset, PublicCloneable, Serializable
A collection of
VectorSeries
objects.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSeries
(VectorSeries series) Adds a series to the collection and sends aDatasetChangeEvent
to all registered listeners.clone()
Returns a clone of this instance.boolean
Tests this instance for equality with an arbitrary object.int
getItemCount
(int series) Returns the number of items in the specified series.getSeries
(int series) Returns a series from the collection.int
Returns the number of series in the collection.getSeriesKey
(int series) Returns the key for a series.getVector
(int series, int item) Returns the vector for an item in a series.double
getVectorXValue
(int series, int item) Returns the x-component of the vector for an item in a series.double
getVectorYValue
(int series, int item) Returns the y-component of the vector for an item in a series.getX
(int series, int item) Returns the x-value for an item within a series.double
getXValue
(int series, int item) Returns the x-value for an item within a series.getY
(int series, int item) Returns the y-value for an item within a series.double
getYValue
(int series, int item) Returns the y-value for an item within a series.int
indexOf
(VectorSeries series) Returns the index of the specified series, or -1 if that series is not present in the dataset.void
Removes all the series from the collection and sends aDatasetChangeEvent
to all registered listeners.boolean
removeSeries
(VectorSeries series) Removes the specified series from the collection and sends aDatasetChangeEvent
to 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
-
Constructor Details
-
VectorSeriesCollection
public VectorSeriesCollection()Creates a newVectorSeriesCollection
instance.
-
-
Method Details
-
addSeries
Adds a series to the collection and sends aDatasetChangeEvent
to all registered listeners.- Parameters:
series
- the series (null
not permitted).
-
removeSeries
Removes the specified series from the collection and sends aDatasetChangeEvent
to all registered listeners.- Parameters:
series
- the series (null
not permitted).- Returns:
- A boolean indicating whether the series has actually been removed.
-
removeAllSeries
Removes all the series from the collection and sends aDatasetChangeEvent
to all registered listeners. -
getSeriesCount
Returns the number of series in the collection.- Specified by:
getSeriesCount
in interfaceSeriesDataset
- Specified by:
getSeriesCount
in classAbstractSeriesDataset
- Returns:
- The series count.
-
getSeries
Returns a series from the collection.- Parameters:
series
- the series index (zero-based).- Returns:
- The series.
- Throws:
IllegalArgumentException
- ifseries
is not in the range0
togetSeriesCount() - 1
.
-
getSeriesKey
Returns the key for a series.- Specified by:
getSeriesKey
in interfaceSeriesDataset
- Specified by:
getSeriesKey
in classAbstractSeriesDataset
- Parameters:
series
- the series index (in the range0
togetSeriesCount() - 1
).- Returns:
- The key for a series.
- Throws:
IllegalArgumentException
- ifseries
is not in the specified range.
-
indexOf
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.
-
getItemCount
Returns the number of items in the specified series.- Specified by:
getItemCount
in interfaceXYDataset
- Parameters:
series
- the series (zero-based index).- Returns:
- The item count.
- Throws:
IllegalArgumentException
- ifseries
is not in the range0
togetSeriesCount() - 1
.
-
getXValue
Returns the x-value for an item within a series.- Specified by:
getXValue
in interfaceXYDataset
- Overrides:
getXValue
in classAbstractXYDataset
- Parameters:
series
- the series index.item
- the item index.- Returns:
- The x-value.
-
getX
Returns the x-value for an item within a series. Note that this method creates a newDouble
instance every time it is called---usegetXValue(int, int)
instead, if possible. -
getYValue
Returns the y-value for an item within a series.- Specified by:
getYValue
in interfaceXYDataset
- Overrides:
getYValue
in classAbstractXYDataset
- Parameters:
series
- the series index.item
- the item index.- Returns:
- The y-value.
-
getY
Returns the y-value for an item within a series. Note that this method creates a newDouble
instance every time it is called---usegetYValue(int, int)
instead, if possible. -
getVector
Returns the vector for an item in a series.- Specified by:
getVector
in interfaceVectorXYDataset
- Parameters:
series
- the series index.item
- the item index.- Returns:
- The vector (possibly
null
).
-
getVectorXValue
Returns the x-component of the vector for an item in a series.- Specified by:
getVectorXValue
in interfaceVectorXYDataset
- Parameters:
series
- the series index.item
- the item index.- Returns:
- The x-component of the vector.
-
getVectorYValue
Returns the y-component of the vector for an item in a series.- Specified by:
getVectorYValue
in interfaceVectorXYDataset
- Parameters:
series
- the series index.item
- the item index.- Returns:
- The y-component of the vector.
-
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equals
in classAbstractDataset
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
clone
Returns a clone of this instance.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classAbstractDataset
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if there is a problem.
-