Class DefaultValueDataset

java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.DefaultValueDataset
All Implemented Interfaces:
ObjectInputValidation, Serializable, Cloneable, PublicCloneable, Dataset, ValueDataset, Value

A dataset that stores a single value (that is possibly null). This class provides a default implementation of the ValueDataset interface.
See Also:
  • Constructor Details

    • 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 Details

    • getValue

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

      public void setValue(Number value)
      Sets the value and sends a DatasetChangeEvent to all registered listeners.
      Parameters:
      value - the new value (null permitted).
    • equals

      public boolean equals(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.