org.jfree.data.general

## Class DefaultValueDataset

- java.lang.Object
- - org.jfree.data.general.AbstractDataset
  - - org.jfree.data.general.DefaultValueDataset

All Implemented Interfaces:
  java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, Dataset, ValueDataset, Value, org.jfree.util.PublicCloneable

    public class DefaultValueDataset
    extends AbstractDataset
    implements ValueDataset, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable

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

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`DefaultValueDataset()` Constructs a new dataset, initially empty.
`DefaultValueDataset(double value)` Creates a new dataset with the specified value.
`DefaultValueDataset(java.lang.Number value)` Creates a new dataset with the specified value.

### Method Summary

Methods
`boolean` `equals(java.lang.Object obj)` Tests this dataset for equality with an arbitrary object.
`java.lang.Number` `getValue()` Returns the value.
`int` `hashCode()` Returns a hash code.
`void` `setValue(java.lang.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`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.jfree.data.general.Dataset

`addChangeListener, getGroup, removeChangeListener, setGroup`

### Methods inherited from interface org.jfree.util.PublicCloneable

`clone`

### 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(java.lang.Number value)

Creates a new dataset with the specified value.

Parameters:
  `value` - the initial value (`null` permitted).

### Method Detail

#### getValue

    public java.lang.Number getValue()

Returns the value.

Specified by:
  `getValue` in interface `Value`
Returns:
  The value (possibly `null`).

#### setValue

    public void setValue(java.lang.Number value)

Sets the value and sends a `DatasetChangeEvent` to all registered listeners.

Parameters:
  `value` - the new value (`null` permitted).

#### equals

    public boolean equals(java.lang.Object obj)

Tests this dataset for equality with an arbitrary object.

Overrides:
  `equals` in class `java.lang.Object`
Parameters:
  `obj` - the object (`null` permitted).
Returns:
  A boolean.

#### hashCode

    public int hashCode()

Returns a hash code.

Overrides:
  `hashCode` in class `java.lang.Object`
Returns:
  A hash code.