Documentation of 'org.jfree.data.general.Series' Java class
Series
org.jfree.data.general

Class Series

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    ComparableObjectSeries, MatrixSeries, TaskSeries, TimePeriodValues, TimeSeries, XYErrorBarSeries, XYSeries


    public abstract class Series
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    Base class representing a data series. Subclasses are left to implement the actual data structures.

    The series has two properties ("Key" 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

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      void addChangeListener(SeriesChangeListener listener)
      Registers an object with this series, to receive notification whenever the series changes.
      void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
      Adds a property change listener to the series.
      void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
      Adds a vetoable property change listener to the series.
      java.lang.Object clone()
      Returns a clone of the series.
      boolean equals(java.lang.Object obj)
      Tests the series for equality with another object.
      void fireSeriesChanged()
      General method for signalling to registered listeners that the series has been changed.
      java.lang.String getDescription()
      Returns a description of the series.
      abstract int getItemCount()
      Returns the number of data items in the series.
      java.lang.Comparable getKey()
      Returns the key for 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.
      boolean isEmpty()
      Returns true if the series contains no data items, and false otherwise.
      void removeChangeListener(SeriesChangeListener listener)
      Deregisters an object, so that it not longer receives notification whenever the series changes.
      void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      Removes a property change listener from the series.
      void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
      Removes a vetoable property change listener from the series.
      void setDescription(java.lang.String description)
      Sets the description of the series and sends a PropertyChangeEvent to all registered listeners.
      void setKey(java.lang.Comparable key)
      Sets the key for the series and sends a VetoableChangeEvent (with the property name "Key") to all registered listeners.
      void setNotify(boolean notify)
      Sets the flag that controls whether or not change events are sent to registered listeners.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getKey

        public java.lang.Comparable getKey()
        Returns the key for the series.
        Returns:
        The series key (never null).
        See Also:
        setKey(Comparable)
      • setKey

        public void setKey(java.lang.Comparable key)
        Sets the key for the series and sends a VetoableChangeEvent (with the property name "Key") to all registered listeners. For backwards compatibility, this method also fires a regular PropertyChangeEvent. If the key change is vetoed this method will throw an IllegalArgumentException.
        Parameters:
        key - the key (null not permitted).
        See Also:
        getKey()
      • getDescription

        public java.lang.String getDescription()
        Returns a description of the series.
        Returns:
        The series description (possibly null).
        See Also:
        setDescription(String)
      • setDescription

        public void setDescription(java.lang.String description)
        Sets the description of the series and sends a PropertyChangeEvent to all registered listeners.
        Parameters:
        description - the description (null permitted).
        See Also:
        getDescription()
      • getNotify

        public boolean getNotify()
        Returns the flag that controls whether or not change events are sent to registered listeners.
        Returns:
        A boolean.
        See Also:
        setNotify(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.
        See Also:
        getNotify()
      • isEmpty

        public boolean isEmpty()
        Returns true if the series contains no data items, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.7
      • getItemCount

        public abstract int getItemCount()
        Returns the number of data items in the series.
        Returns:
        The number of data items in the series.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns a clone of the series.

        Notes:

        • No need to clone the name or description, since String object is immutable.
        • We set the listener list to empty, since the listeners did not register with the clone.
        • Same applies to the PropertyChangeSupport instance.
        Overrides:
        clone in class java.lang.Object
        Returns:
        A clone of the series.
        Throws:
        java.lang.CloneNotSupportedException - not thrown by this class, but subclasses may differ.
      • equals

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

        public int hashCode()
        Returns a hash code.
        Overrides:
        hashCode in class java.lang.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(java.beans.PropertyChangeListener listener)
        Adds a property change listener to the series.
        Parameters:
        listener - the listener.
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Removes a property change listener from the series.
        Parameters:
        listener - the listener.
      • addVetoableChangeListener

        public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
        Adds a vetoable property change listener to the series.
        Parameters:
        listener - the listener.
        Since:
        1.0.14
      • removeVetoableChangeListener

        public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
        Removes a vetoable property change listener from the series.
        Parameters:
        listener - the listener.
        Since:
        1.0.14

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.