Module org.jfree.chart3d
Package org.jfree.chart3d.data.xyz
Class XYZSeriesCollection<S extends Comparable<S>>
java.lang.Object
org.jfree.chart3d.data.AbstractDataset3D
org.jfree.chart3d.data.xyz.XYZSeriesCollection<S>
- All Implemented Interfaces:
Serializable
,EventListener
,Dataset3D
,Series3DChangeListener
,XYZDataset<S>
public class XYZSeriesCollection<S extends Comparable<S>>
extends AbstractDataset3D
implements XYZDataset<S>, Series3DChangeListener, Serializable
A collection of
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
XYZSeries
objects (implements the XYZDataset
interface so that it can be used as a source of data for an
XYZRenderer
on an XYZPlot
).
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a series to the collection (note that the series key must be unique within the collection).boolean
Tests this dataset for equality with an arbitrary object.int
getItemCount
(int seriesIndex) Returns the number of items in the specified series.getSeries
(int index) Returns the series with the specified index.getSeries
(Comparable<?> key) Returns the series with the specified key, ornull
if there is no such series.int
Returns the number of series in the collection.int
getSeriesIndex
(S key) Returns the index of the series with the specified key, or-1
if there is no series with the specified key.getSeriesKey
(int seriesIndex) Returns the key for the specified series.Returns a new list containing all the series keys.double
getX
(int seriesIndex, int itemIndex) Returns the x-value for one item in a series.double
getY
(int seriesIndex, int itemIndex) Returns the y-value for one item in a series.double
getZ
(int seriesIndex, int itemIndex) Returns the z-value for one item in a series.int
hashCode()
void
remove
(int seriesIndex) Removes a series from the collection and sends aDataset3DChangeEvent
to all registered listeners.void
Removes a series from the collection and sends aDataset3DChangeEvent
to all registered listeners.void
Removes all the series from the collection and sends aDataset3DChangeEvent
to all registered listeners.void
seriesChanged
(Series3DChangeEvent event) Called when an observed series changes in some way.toString()
Returns a string representation of this instance, primarily for debugging purposes.Methods inherited from class org.jfree.chart3d.data.AbstractDataset3D
addChangeListener, fireChangeEvent, fireDatasetChanged, hasListener, isNotify, notifyListeners, removeChangeListener, setNotify
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jfree.chart3d.data.Dataset3D
addChangeListener, hasListener, removeChangeListener
-
Constructor Details
-
XYZSeriesCollection
public XYZSeriesCollection()Creates a new (empty)XYZSeriesCollection
instance.
-
-
Method Details
-
getSeriesCount
Returns the number of series in the collection.- Specified by:
getSeriesCount
in interfaceXYZDataset<S extends Comparable<S>>
- Returns:
- The number of series in the collection.
-
getSeriesIndex
Returns the index of the series with the specified key, or-1
if there is no series with the specified key.- Specified by:
getSeriesIndex
in interfaceXYZDataset<S extends Comparable<S>>
- Parameters:
key
- the key (null
not permitted).- Returns:
- The series index or
-1
.
-
getSeriesKeys
Returns a new list containing all the series keys. Modifying this list will have no impact on theXYZSeriesCollection
instance.- Specified by:
getSeriesKeys
in interfaceXYZDataset<S extends Comparable<S>>
- Returns:
- A list containing the series keys (possibly empty, but never
null
).
-
getSeriesKey
Returns the key for the specified series.- Specified by:
getSeriesKey
in interfaceXYZDataset<S extends Comparable<S>>
- Parameters:
seriesIndex
- the series index.- Returns:
- The series key.
- Since:
- 1.3
-
add
Adds a series to the collection (note that the series key must be unique within the collection). The collection will automatically register to receive change events from the series, and fire aDataset3DChangeEvent
whenever the data in the series changes.- Parameters:
series
- the series (null
not permitted).
-
remove
Removes a series from the collection and sends aDataset3DChangeEvent
to all registered listeners.- Parameters:
seriesIndex
- the series index.- Since:
- 1.6
-
remove
Removes a series from the collection and sends aDataset3DChangeEvent
to all registered listeners. If the series is not part of the collection, this method does nothing.- Parameters:
series
- the series (null
not permitted).- Since:
- 1.6
-
removeAll
Removes all the series from the collection and sends aDataset3DChangeEvent
to all registered listeners. If the collection is already empty, this method does nothing. -
getSeries
Returns the series with the specified index.- Parameters:
index
- the series index.- Returns:
- The series.
- Since:
- 1.2
-
getSeries
Returns the series with the specified key, ornull
if there is no such series.- Parameters:
key
- the key (null
not permitted).- Returns:
- The series.
- Since:
- 1.2
-
getItemCount
Returns the number of items in the specified series.- Specified by:
getItemCount
in interfaceXYZDataset<S extends Comparable<S>>
- Parameters:
seriesIndex
- the series index.- Returns:
- The number of items in the specified series.
-
getX
Returns the x-value for one item in a series.- Specified by:
getX
in interfaceXYZDataset<S extends Comparable<S>>
- Parameters:
seriesIndex
- the series index.itemIndex
- the item index.- Returns:
- The x-value.
-
getY
Returns the y-value for one item in a series.- Specified by:
getY
in interfaceXYZDataset<S extends Comparable<S>>
- Parameters:
seriesIndex
- the series index.itemIndex
- the item index.- Returns:
- The y-value.
-
getZ
Returns the z-value for one item in a series.- Specified by:
getZ
in interfaceXYZDataset<S extends Comparable<S>>
- Parameters:
seriesIndex
- the series index.itemIndex
- the item index.- Returns:
- The z-value.
-
seriesChanged
Called when an observed series changes in some way.- Specified by:
seriesChanged
in interfaceSeries3DChangeListener
- Parameters:
event
- information about the change.- Since:
- 1.6
-
equals
Tests this dataset for equality with an arbitrary object. -
hashCode
-
toString
Returns a string representation of this instance, primarily for debugging purposes.
Implementation note: the current implementation (which is subject to change) writes the dataset in JSON format usingJSONUtils.writeXYZDataset(org.jfree.chart3d.data.xyz.XYZDataset)
.
-