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).public class XYZSeries<K extends java.lang.Comparable<K>> extends java.lang.Object implements java.io.Serializable
(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.
| Constructor and Description |
|---|
XYZSeries(K key)
Creates a new series with the specified key.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double x,
double y,
double z)
Adds a new data item to the series and sends a
Series3DChangeEvent to all registered listeners. |
void |
add(XYZDataItem item)
Adds a new data item to the series and sends a
Series3DChangeEvent to all registered listeners. |
void |
addChangeListener(Series3DChangeListener listener)
Registers an object with this series, to receive notification whenever
the series changes.
|
boolean |
equals(java.lang.Object obj)
Tests this series for equality with an arbitrary object.
|
void |
fireSeriesChanged()
General method for signaling to registered listeners that the series
has been changed.
|
int |
getItemCount()
Returns the number of items in the series.
|
java.util.List<XYZDataItem> |
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).
|
K |
getKey()
Returns the series key.
|
boolean |
getNotify()
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 |
notifyListeners(Series3DChangeEvent event)
Sends a change event to all registered listeners.
|
void |
remove(int itemIndex)
Removes a data item from the series and sends a
Series3DChangeEvent 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.
|
public XYZSeries(K key)
XYZSeriesCollection
always has a unique key. For the same reason, the key type should be
an immutable class.key - the key (null not permitted).public int getItemCount()
public java.util.List<XYZDataItem> getItems()
public double getXValue(int itemIndex)
itemIndex - the item index.public double getYValue(int itemIndex)
itemIndex - the item index.public double getZValue(int itemIndex)
itemIndex - the item index.public void add(double x, double y, double z)
Series3DChangeEvent to all registered listeners.x - the x-value.y - the y-value.z - the z-value.public void add(XYZDataItem item)
Series3DChangeEvent to all registered listeners.item - the data item (null not permitted).public void remove(int itemIndex)
Series3DChangeEvent to all registered listeners.itemIndex - the item index.public void addChangeListener(Series3DChangeListener listener)
Objects being registered must implement the
Series3DChangeListener interface.
listener - the listener to register.public void removeChangeListener(Series3DChangeListener listener)
listener - the listener to deregister.public boolean getNotify()
setNotify(boolean)public void setNotify(boolean notify)
notify - the new value of the flag.getNotify()public void fireSeriesChanged()
protected void notifyListeners(Series3DChangeEvent event)
event - contains information about the event that triggered the
notification.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to test (null permitted).public int hashCode()
hashCode in class java.lang.Object