Class Series<K extends Comparable<K>>

    • Constructor Detail

      • Series

        protected Series​(K key)
        Creates a new series with the specified key and description.
        Parameters:
        key - the series key (null not permitted).
    • Method Detail

      • getKey

        public K getKey()
        Returns the key for the series.
        Returns:
        The series key (never null).
      • getNotify

        public boolean getNotify()
        Returns the flag that controls whether 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 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 Object clone()
                     throws 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 Object
        Returns:
        A clone of the series.
        Throws:
        CloneNotSupportedException - not thrown by this class, but subclasses may differ.
      • equals

        public boolean equals​(Object obj)
        Tests the series for equality with another object.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object (null permitted).
        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 no 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.
      • notifyListeners

        protected void notifyListeners​(SeriesChangeEvent event)
        Sends a change event to all registered listeners.
        Parameters:
        event - contains information about the event that triggered the notification.