Class AssociativeDataWithDefault<KEY,VALUE>

java.lang.Object
io.deephaven.plot.datasets.data.AssociativeData<KEY,VALUE>
io.deephaven.plot.datasets.data.AssociativeDataWithDefault<KEY,VALUE>
All Implemented Interfaces:
PlotExceptionCause, Serializable

public class AssociativeDataWithDefault<KEY,VALUE> extends AssociativeData<KEY,VALUE>
Dataset which has values associated with keys. When the dataset has no value associated with a given key, it falls back to a specified default value.
See Also:
  • Constructor Details

    • AssociativeDataWithDefault

      public AssociativeDataWithDefault(PlotInfo plotInfo)
      Parameters:
      plotInfo - plot information
  • Method Details

    • getDefault

      public VALUE getDefault()
      Gets the default value for this dataset.
      Returns:
      default value for this dataset
    • setDefault

      public void setDefault(VALUE value)
      Defines the default value for this dataset.
      Parameters:
      value - default value
    • getSpecific

      public AssociativeData<KEY,VALUE> getSpecific()
      Gets this dataset's key-value pairs as an AssociativeData dataset.
      Returns:
      AssociativeData dataset representing this datasets key-value pairs
    • setSpecific

      public void setSpecific(AssociativeData<KEY,VALUE> provider)
      Sets this dataset's key-value pairs.
      Parameters:
      provider - dataset holding key-value pairs
    • get

      public VALUE get(KEY key)
      Description copied from class: AssociativeData
      Gets the value associated with the key
      Specified by:
      get in class AssociativeData<KEY,VALUE>
      Parameters:
      key - key
      Returns:
      value associated with the key
    • isModifiable

      public boolean isModifiable()
      Description copied from class: AssociativeData
      Whether the dataset is modifiable.
      Specified by:
      isModifiable in class AssociativeData<KEY,VALUE>
      Returns:
      true if the dataset is modifiable, false if not
    • put

      public void put(KEY key, VALUE value)
      Description copied from class: AssociativeData
      Adds the key-value pair to the dataset.
      Specified by:
      put in class AssociativeData<KEY,VALUE>
      Parameters:
      key - key
      value - value
    • putAll

      public <K extends KEY, V extends VALUE> void putAll(Map<K,V> values)
      Description copied from class: AssociativeData
      Adds all key-value pairs in the map to the dataset.
      Specified by:
      putAll in class AssociativeData<KEY,VALUE>
      Type Parameters:
      K - type of the keys in values
      V - type of the values in values
      Parameters:
      values - keypair map
    • set

      public void set(AssociativeDataWithDefault<KEY,VALUE> data)
      Sets this dataset's values equal to the values in another dataset.
      Parameters:
      data - dataset to get values from.