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 void
addChangeListener(SeriesChangeListener listener)
Registers an object with this series, to receive notification whenever the series changes.void
addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener to the series.Object
clone()
Returns a clone of the series.boolean
equals(Object object)
Tests the series for equality with another object.void
fireSeriesChanged()
General method for signalling to registered listeners that the series has been changed.String
getDescription()
Returns a description of the series.String
getName()
Returns the name of the series.boolean
getNotify()
Returns the flag that controls whether or not change events are sent to registered listeners.int
hashCode()
Returns a hash code.void
removeChangeListener(SeriesChangeListener listener)
Deregisters an object, so that it not longer receives notification whenever the series changes.void
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener from the series.void
setDescription(String description)
Sets the description of the series.void
setName(String name)
Sets the name of the series.void
setNotify(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 (null
not 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 (null
permitted).
-
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
SeriesChangeListener
interface.- 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.
-