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 Details

    • getName

      public String getName()
      Returns the name of the series.
      Returns:
      the series name (never null).
    • setName

      public void setName​(String name)
      Sets the name of the series.
      Parameters:
      name - the name (null not permitted).
    • getDescription

      public String getDescription()
      Returns a description of the series.
      Returns:
      the series description (possibly null).
    • setDescription

      public void setDescription​(String description)
      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

      public Object clone() throws CloneNotSupportedException
      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

      public boolean equals​(Object object)
      Tests the series for equality with another object.
      Overrides:
      equals in class Object
      Parameters:
      object - the object.
      Returns:
      true or false.
    • hashCode

      public int hashCode()
      Returns a hash code.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code.
    • addChangeListener

      public void addChangeListener​(SeriesChangeListener listener)
      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

      public void removeChangeListener​(SeriesChangeListener listener)
      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

      public void addPropertyChangeListener​(PropertyChangeListener listener)
      Adds a property change listener to the series.
      Parameters:
      listener - The listener.
    • removePropertyChangeListener

      public void removePropertyChangeListener​(PropertyChangeListener listener)
      Removes a property change listener from the series.
      Parameters:
      listener - The listener.