Class DefaultKeyedValueDataset

    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For serialization.
        See Also:
        Constant Field Values
      • data

        private KeyedValue data
        Storage for the data.
    • Constructor Detail

      • DefaultKeyedValueDataset

        public DefaultKeyedValueDataset()
        Constructs a new dataset, initially empty.
      • DefaultKeyedValueDataset

        public DefaultKeyedValueDataset​(java.lang.Comparable key,
                                        java.lang.Number value)
        Creates a new dataset with the specified initial value.
        Parameters:
        key - the key.
        value - the value (null permitted).
      • DefaultKeyedValueDataset

        public DefaultKeyedValueDataset​(KeyedValue data)
        Creates a new dataset that uses the data from a KeyedValue instance.
        Parameters:
        data - the data (null permitted).
    • Method Detail

      • getKey

        public java.lang.Comparable getKey()
        Returns the key associated with the value, or null if the dataset has no data item.
        Specified by:
        getKey in interface KeyedValue
        Returns:
        The key.
      • getValue

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

        public void updateValue​(java.lang.Number value)
        Updates the value.
        Parameters:
        value - the new value (null permitted).
      • setValue

        public void setValue​(java.lang.Comparable key,
                             java.lang.Number value)
        Sets the value for the dataset and sends a DatasetChangeEvent to all registered listeners.
        Parameters:
        key - the key.
        value - the value (null permitted).
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this dataset for equality with an arbitrary object.
        Overrides:
        equals in class AbstractDataset
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Returns a hash code.
        Overrides:
        hashCode in class AbstractDataset
        Returns:
        A hash code.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Creates a clone of the dataset.
        Overrides:
        clone in class AbstractDataset
        Returns:
        A clone.
        Throws:
        java.lang.CloneNotSupportedException - This class will not throw this exception, but subclasses (if any) might.