public abstract class AbstractDataset extends java.lang.Object implements Dataset, java.lang.Cloneable, java.io.Serializable, java.io.ObjectInputValidation
Dataset
interface, containing a
mechanism for registering change listeners.Modifier | Constructor and Description |
---|---|
protected |
AbstractDataset()
Constructs a dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(DatasetChangeListener listener)
Registers an object to receive notification of changes to the dataset.
|
java.lang.Object |
clone()
Returns a clone of the dataset.
|
protected void |
fireDatasetChanged()
Notifies all registered listeners that the dataset has changed,
provided that the
notify flag has not been set to
false . |
DatasetGroup |
getGroup()
Returns the dataset group for the dataset.
|
boolean |
getNotify()
Returns the value of the notify flag.
|
boolean |
hasListener(java.util.EventListener listener)
Returns
true if the specified object is registered with
the dataset as a listener. |
protected void |
notifyListeners(DatasetChangeEvent event)
Notifies all registered listeners that the dataset has changed.
|
void |
removeChangeListener(DatasetChangeListener listener)
Deregisters an object so that it no longer receives notification of
changes to the dataset.
|
void |
setGroup(DatasetGroup group)
Sets the dataset group for the dataset.
|
void |
setNotify(boolean notify)
Sets the notify flag, which controls whether or not the
fireDatasetChanged()
method notifies listeners. |
void |
validateObject()
Validates the object.
|
protected AbstractDataset()
public DatasetGroup getGroup()
getGroup
in interface Dataset
null
).setGroup(DatasetGroup)
public void setGroup(DatasetGroup group)
setGroup
in interface Dataset
group
- the group (null
not permitted).getGroup()
public boolean getNotify()
true
. If this is false
, calls to the
fireDatasetChanged()
method will NOT trigger a dataset
change event.public void setNotify(boolean notify)
fireDatasetChanged()
method notifies listeners. Setting this flag to true
will
trigger a DatasetChangeEvent
because there may be
queued up changes.notify
- the new flag value.public void addChangeListener(DatasetChangeListener listener)
addChangeListener
in interface Dataset
listener
- the object to register.removeChangeListener(DatasetChangeListener)
public void removeChangeListener(DatasetChangeListener listener)
removeChangeListener
in interface Dataset
listener
- the object to deregister.addChangeListener(DatasetChangeListener)
public boolean hasListener(java.util.EventListener listener)
true
if the specified object is registered with
the dataset as a listener. Most applications won't need to call this
method, it exists mainly for use by unit testing code.listener
- the listener.addChangeListener(DatasetChangeListener)
,
removeChangeListener(DatasetChangeListener)
protected void fireDatasetChanged()
notify
flag has not been set to
false
.addChangeListener(DatasetChangeListener)
protected void notifyListeners(DatasetChangeEvent event)
event
- contains information about the event that triggered the
notification.addChangeListener(DatasetChangeListener)
,
removeChangeListener(DatasetChangeListener)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
DatasetChangeListener
references that have been registered with
this dataset.clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the dataset does not support
cloning.public void validateObject() throws java.io.InvalidObjectException
validateObject
in interface java.io.ObjectInputValidation
java.io.InvalidObjectException
- If the object cannot validate itself.