Module org.jfree.chart3d
Package org.jfree.chart3d.data.xyz
Class XYZSeries<K extends Comparable<K>>
java.lang.Object
org.jfree.chart3d.data.xyz.XYZSeries<K>
- Type Parameters:
K
- the type for the series key (it is recommended that this is a class of immutable objects, because the series key should never be modified).
- All Implemented Interfaces:
Serializable
A data series containing a sequence 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.
(x, y, z)
data items.
The series has an immutable key to identify it, and can be added to an
XYZSeriesCollection
to create a dataset. When a series is part
of an XYZSeriesCollection
, the collection will register with the
series to receive change events - in this way, the collection can notify
its own listeners when a change is made to the series.
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
add
(double x, double y, double z) Adds a new data item to the series and sends aSeries3DChangeEvent
to all registered listeners.void
add
(XYZDataItem item) Adds a new data item to the series and sends aSeries3DChangeEvent
to all registered listeners.void
addChangeListener
(Series3DChangeListener listener) Registers an object with this series, to receive notification whenever the series changes.boolean
Tests this series for equality with an arbitrary object.void
General method for signaling to registered listeners that the series has been changed.int
Returns the number of items in the series.getItems()
Returns a list containing all the items for the dataset (a new list is created each time this method is called, so the list can be freely modified without affecting the state of this series).getKey()
Returns the series key.boolean
Returns the flag that controls whether or not change events are sent to registered listeners.double
getXValue
(int itemIndex) Returns the x-value for the specified item in the series.double
getYValue
(int itemIndex) Returns the y-value for the specified item in the series.double
getZValue
(int itemIndex) Returns the z-value for the specified item in the series.int
hashCode()
protected void
Sends a change event to all registered listeners.void
remove
(int itemIndex) Removes a data item from the series and sends aSeries3DChangeEvent
to all registered listeners.void
removeChangeListener
(Series3DChangeListener listener) Deregisters an object, so that it not longer receives notification whenever the series changes.void
setNotify
(boolean notify) Sets the flag that controls whether or not change events are sent to registered listeners.
-
Constructor Details
-
XYZSeries
Creates a new series with the specified key. Note that the series key cannot be changed after it has been set in the constructor - this is by design, to ensure that each series in aXYZSeriesCollection
always has a unique key. For the same reason, the key type should be an immutable class.- Parameters:
key
- the key (null
not permitted).
-
-
Method Details
-
getKey
Returns the series key.- Returns:
- The series key (never
null
).
-
getItemCount
Returns the number of items in the series.- Returns:
- The number of items in the series.
-
getItems
Returns a list containing all the items for the dataset (a new list is created each time this method is called, so the list can be freely modified without affecting the state of this series).- Returns:
- A list of all items.
- Since:
- 1.6
-
getXValue
Returns the x-value for the specified item in the series.- Parameters:
itemIndex
- the item index.- Returns:
- The x-value.
-
getYValue
Returns the y-value for the specified item in the series.- Parameters:
itemIndex
- the item index.- Returns:
- The y-value.
-
getZValue
Returns the z-value for the specified item in the series.- Parameters:
itemIndex
- the item index.- Returns:
- The z-value.
-
add
Adds a new data item to the series and sends aSeries3DChangeEvent
to all registered listeners.- Parameters:
x
- the x-value.y
- the y-value.z
- the z-value.
-
add
Adds a new data item to the series and sends aSeries3DChangeEvent
to all registered listeners.- Parameters:
item
- the data item (null
not permitted).
-
remove
Removes a data item from the series and sends aSeries3DChangeEvent
to all registered listeners.- Parameters:
itemIndex
- the item index.- Since:
- 1.6
-
addChangeListener
Registers an object with this series, to receive notification whenever the series changes.Objects being registered must implement the
Series3DChangeListener
interface.- Parameters:
listener
- the listener to register.- Since:
- 1.6
-
removeChangeListener
Deregisters an object, so that it not longer receives notification whenever the series changes.- Parameters:
listener
- the listener to deregister.- Since:
- 1.6
-
getNotify
Returns the flag that controls whether or not change events are sent to registered listeners.- Returns:
- A boolean.
- Since:
- 1.6
- See Also:
-
setNotify
Sets the flag that controls whether or not change events are sent to registered listeners.- Parameters:
notify
- the new value of the flag.- Since:
- 1.6
- See Also:
-
fireSeriesChanged
General method for signaling to registered listeners that the series has been changed.- Since:
- 1.6
-
notifyListeners
Sends a change event to all registered listeners.- Parameters:
event
- contains information about the event that triggered the notification.- Since:
- 1.6
-
equals
Tests this series for equality with an arbitrary object. -
hashCode
-