org.jfree.data.general

Class DefaultValueDataset

Implemented Interfaces:
Cloneable, Dataset, ObjectInputValidation, PublicCloneable, Serializable, Value, ValueDataset

public class DefaultValueDataset
extends AbstractDataset
implements ValueDataset, Cloneable, PublicCloneable, Serializable

A dataset that stores a single value (that is possibly null). This class provides a default implementation of the ValueDataset interface.

Constructor Summary

DefaultValueDataset()
Constructs a new dataset, initially empty.
DefaultValueDataset(Number value)
Creates a new dataset with the specified value.
DefaultValueDataset(double value)
Creates a new dataset with the specified value.

Method Summary

boolean
equals(Object obj)
Tests this dataset for equality with an arbitrary object.
Number
getValue()
Returns the value.
int
hashCode()
Returns a hash code.
void
setValue(Number value)
Sets the value and sends a DatasetChangeEvent to all registered listeners.

Methods inherited from class org.jfree.data.general.AbstractDataset

addChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject

Constructor Details

DefaultValueDataset

public DefaultValueDataset()
Constructs a new dataset, initially empty.

DefaultValueDataset

public DefaultValueDataset(Number value)
Creates a new dataset with the specified value.
Parameters:
value - the initial value (null permitted).

DefaultValueDataset

public DefaultValueDataset(double value)
Creates a new dataset with the specified value.
Parameters:
value - the value.

Method Details

equals

public boolean equals(Object obj)
Tests this dataset for equality with an arbitrary object.
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

getValue

public Number getValue()
Returns the value.
Specified by:
getValue in interface Value
Returns:
The value (possibly null).

hashCode

public int hashCode()
Returns a hash code.
Returns:
A hash code.

setValue

public void setValue(Number value)
Sets the value and sends a DatasetChangeEvent to all registered listeners.
Parameters:
value - the new value (null permitted).