Package org.jfree.data
Class Series
java.lang.Object
org.jfree.data.Series
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
MatrixSeries,TaskSeries,TimePeriodValues,TimeSeries,XYSeries
public class Series extends Object implements Cloneable, Serializable
Base class representing a data series. Subclasses are left to implement the
actual data structures.
The series has two properties ("Name" and "Description") for which you can
register a PropertyChangeListener.
You can also register a SeriesChangeListener to receive notification
of changes to the series data.
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description voidaddChangeListener(SeriesChangeListener listener)Registers an object with this series, to receive notification whenever the series changes.voidaddPropertyChangeListener(PropertyChangeListener listener)Adds a property change listener to the series.Objectclone()Returns a clone of the series.booleanequals(Object object)Tests the series for equality with another object.voidfireSeriesChanged()General method for signalling to registered listeners that the series has been changed.StringgetDescription()Returns a description of the series.StringgetName()Returns the name of the series.booleangetNotify()Returns the flag that controls whether or not change events are sent to registered listeners.inthashCode()Returns a hash code.voidremoveChangeListener(SeriesChangeListener listener)Deregisters an object, so that it not longer receives notification whenever the series changes.voidremovePropertyChangeListener(PropertyChangeListener listener)Removes a property change listener from the series.voidsetDescription(String description)Sets the description of the series.voidsetName(String name)Sets the name of the series.voidsetNotify(boolean notify)Sets the flag that controls whether or not change events are sent to registered listeners.
-
Method Details
-
getName
Returns the name of the series.- Returns:
- the series name (never
null).
-
setName
Sets the name of the series.- Parameters:
name- the name (nullnot permitted).
-
getDescription
Returns a description of the series.- Returns:
- the series description (possibly
null).
-
setDescription
Sets the description of the series.- Parameters:
description- the description (nullpermitted).
-
getNotify
public boolean getNotify()Returns the flag that controls whether or not change events are sent to registered listeners.- Returns:
- a boolean.
-
setNotify
public void setNotify(boolean notify)Sets the flag that controls whether or not change events are sent to registered listeners.- Parameters:
notify- the new value of the flag.
-
clone
Returns a clone of the series.Notes: 1. No need to clone the name or description, since String object is immutable. 2. We set the listener list to empty, since the listeners did not register with the clone. 3. Same applies to the PropertyChangeSupport instance.
- Returns:
- a clone of the series.
- Throws:
CloneNotSupportedException- not thrown by this class, but subclasses may differ.
-
equals
Tests the series for equality with another object. -
hashCode
public int hashCode()Returns a hash code. -
addChangeListener
Registers an object with this series, to receive notification whenever the series changes.Objects being registered must implement the
SeriesChangeListenerinterface.- Parameters:
listener- the listener to register.
-
removeChangeListener
Deregisters an object, so that it not longer receives notification whenever the series changes.- Parameters:
listener- the listener to deregister.
-
fireSeriesChanged
public void fireSeriesChanged()General method for signalling to registered listeners that the series has been changed. -
addPropertyChangeListener
Adds a property change listener to the series.- Parameters:
listener- The listener.
-
removePropertyChangeListener
Removes a property change listener from the series.- Parameters:
listener- The listener.
-