org.jfree.data.general

Class DefaultValueDataset

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(double value)
Creates a new dataset with the specified value.
DefaultValueDataset(Number value)
Creates a new dataset with the specified value.
Method Summary
booleanequals(Object obj)
Tests this dataset for equality with an arbitrary object.
NumbergetValue()
Returns the value.
inthashCode()
Returns a hash code.
voidsetValue(Number value)
Sets the value and sends a DatasetChangeEvent to all registered listeners.

Constructor Detail

DefaultValueDataset

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

DefaultValueDataset

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

Parameters: value the value.

DefaultValueDataset

public DefaultValueDataset(Number value)
Creates a new dataset with the specified value.

Parameters: value the initial value (null permitted).

Method Detail

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.

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).