public class DefaultKeyedValueDataset extends AbstractDataset implements KeyedValueDataset, java.io.Serializable
KeyedValueDataset
interface.Constructor and Description |
---|
DefaultKeyedValueDataset()
Constructs a new dataset, initially empty.
|
DefaultKeyedValueDataset(java.lang.Comparable key,
java.lang.Number value)
Creates a new dataset with the specified initial value.
|
DefaultKeyedValueDataset(KeyedValue data)
Creates a new dataset that uses the data from a
KeyedValue
instance. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a clone of the dataset.
|
boolean |
equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.
|
java.lang.Comparable |
getKey()
Returns the key associated with the value, or
null if the
dataset has no data item. |
java.lang.Number |
getValue()
Returns the value.
|
int |
hashCode()
Returns a hash code.
|
void |
setValue(java.lang.Comparable key,
java.lang.Number value)
Sets the value for the dataset and sends a
DatasetChangeEvent to
all registered listeners. |
void |
updateValue(java.lang.Number value)
Updates the value.
|
addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addChangeListener, getGroup, removeChangeListener, setGroup
public DefaultKeyedValueDataset()
public DefaultKeyedValueDataset(java.lang.Comparable key, java.lang.Number value)
key
- the key.value
- the value (null
permitted).public DefaultKeyedValueDataset(KeyedValue data)
KeyedValue
instance.data
- the data (null
permitted).public java.lang.Comparable getKey()
null
if the
dataset has no data item.getKey
in interface KeyedValue
public java.lang.Number getValue()
public void updateValue(java.lang.Number value)
value
- the new value (null
permitted).public void setValue(java.lang.Comparable key, java.lang.Number value)
DatasetChangeEvent
to
all registered listeners.key
- the key.value
- the value (null
permitted).public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractDataset
java.lang.CloneNotSupportedException
- This class will not throw this
exception, but subclasses (if any) might.