Class DefaultKeyedValueDataset

java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.DefaultKeyedValueDataset
All Implemented Interfaces:
ObjectInputValidation, Serializable, Cloneable, Dataset, KeyedValueDataset, KeyedValue, Value

public class DefaultKeyedValueDataset
extends AbstractDataset
implements KeyedValueDataset, Serializable
A default implementation of the KeyedValueDataset interface.
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • getKey

      public 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 Number getValue()
      Returns the value.
      Specified by:
      getValue in interface Value
      Returns:
      The value (possibly null).
    • updateValue

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

      public void setValue​(Comparable key, 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​(Object obj)
      Tests this dataset for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • hashCode

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

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