Package org.jfree.data
Class AbstractDataset
java.lang.Object
org.jfree.data.AbstractDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,Dataset
- Direct Known Subclasses:
AbstractSeriesDataset,CategoryToPieDataset,DefaultBoxAndWhiskerCategoryDataset,DefaultCategoryDataset,DefaultKeyedValueDataset,DefaultMeterDataset,DefaultPieDataset,DefaultStatisticalCategoryDataset,DefaultValueDataset,WaferMapDataset
public abstract class AbstractDataset extends Object implements Dataset, Cloneable, Serializable, ObjectInputValidation
An abstract implementation of the
Dataset interface, containing a
mechanism for registering change listeners.- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description voidaddChangeListener(DatasetChangeListener listener)Registers an object to receive notification of changes to the dataset.Objectclone()Returns a clone of the dataset.DatasetGroupgetGroup()Returns the dataset group for the dataset.voidremoveChangeListener(DatasetChangeListener listener)Deregisters an object so that it no longer receives notification of changes to the dataset.voidsetGroup(DatasetGroup group)Sets the dataset group for the dataset.voidvalidateObject()Validates the object.
-
Method Details
-
getGroup
Returns the dataset group for the dataset. -
setGroup
Sets the dataset group for the dataset. -
addChangeListener
Registers an object to receive notification of changes to the dataset.- Specified by:
addChangeListenerin interfaceDataset- Parameters:
listener- the object to register.
-
removeChangeListener
Deregisters an object so that it no longer receives notification of changes to the dataset.- Specified by:
removeChangeListenerin interfaceDataset- Parameters:
listener- the object to deregister.
-
clone
Returns a clone of the dataset.The cloned dataset will NOT include the
DatasetChangeListenerreferences that have been registered with this dataset.- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the dataset does not support cloning.
-
validateObject
Validates the object. We use this opportunity to call listeners who have registered during the deserialization process, as listeners are not serialized. This method is called by the serialization system after the entire graph is read. This object has registered itself to the system with a priority of 10. Other callbacks may register with a higher priority number to be called before this object, or with a lower priority number to be called after the listeners were notified. All listeners are supposed to have register by now, either in their readObject or validateObject methods. Notify them that this dataset has changed.- Specified by:
validateObjectin interfaceObjectInputValidation- Throws:
InvalidObjectException- If the object cannot validate itself.
-