public abstract class Series extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
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.
Modifier | Constructor and Description |
---|---|
protected |
Series(java.lang.Comparable key)
Creates a new series with the specified key.
|
protected |
Series(java.lang.Comparable key,
java.lang.String description)
Creates a new series with the specified key and description.
|
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.
|
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Fires a property change event.
|
void |
fireSeriesChanged()
General method for signalling to registered listeners that the series
has been changed.
|
protected void |
fireVetoableChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Fires a vetoable property change event.
|
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. |
protected void |
notifyListeners(SeriesChangeEvent event)
Sends a change event to all registered listeners.
|
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.
|
protected Series(java.lang.Comparable key)
key
- the series key (null
not permitted).protected Series(java.lang.Comparable key, java.lang.String description)
key
- the series key (null
NOT permitted).description
- the series description (null
permitted).public java.lang.Comparable getKey()
null
).setKey(Comparable)
public void setKey(java.lang.Comparable key)
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.key
- the key (null
not permitted).getKey()
public java.lang.String getDescription()
null
).setDescription(String)
public void setDescription(java.lang.String description)
PropertyChangeEvent
to all registered listeners.description
- the description (null
permitted).getDescription()
public boolean getNotify()
setNotify(boolean)
public void setNotify(boolean notify)
notify
- the new value of the flag.getNotify()
public boolean isEmpty()
true
if the series contains no data items, and
false
otherwise.public abstract int getItemCount()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Notes:
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- not thrown by this class, but
subclasses may differ.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).true
or false
.public int hashCode()
hashCode
in class java.lang.Object
public void addChangeListener(SeriesChangeListener listener)
Objects being registered must implement the SeriesChangeListener
interface.
listener
- the listener to register.public void removeChangeListener(SeriesChangeListener listener)
listener
- the listener to deregister.public void fireSeriesChanged()
protected void notifyListeners(SeriesChangeEvent event)
event
- contains information about the event that triggered the
notification.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener.protected void firePropertyChange(java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
property
- the property key.oldValue
- the old value.newValue
- the new value.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- the listener.public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- the listener.protected void fireVetoableChange(java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException
property
- the property key.oldValue
- the old value.newValue
- the new value.java.beans.PropertyVetoException
- if the change was vetoed.