Class AssociativeDataSwappableTable<KEY,VALUE,VALUECOLUMN>

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

public class AssociativeDataSwappableTable<KEY,VALUE,VALUECOLUMN> extends LiveAssociativeData<KEY,VALUE,VALUECOLUMN>
An AssociativeData dataset backed by a SwappableTable. Table columns hold the keys and associated values. Data types are specified in construction.
See Also:
  • Constructor Details

    • AssociativeDataSwappableTable

      public AssociativeDataSwappableTable(SwappableTable swappableTable, String keyColumn, String valueColumn, Class<KEY> keyColumnType, Class<VALUECOLUMN> valueColumnType, PlotInfo plotInfo)
      Creates an AssociativeDataSwappableTable instance. The swappableTable must have had a lastBy applied! Indices are held in the keyColumn of swappableTable. Their associated values are held in the valueColumn. The data type of the keys is specified by keyColumnType. The data type of the values is specified by valueColumnType.
      Parameters:
      swappableTable - table. Must have a lastBy applied.
      keyColumn - column in swappableTable which holds the key values
      valueColumn - column in swappableTable which holds the values associated with the keys
      keyColumnType - data type of the keys
      valueColumnType - data type of the values
      plotInfo - plot information
      Throws:
      RequirementFailure - swappableTable, keyColumn, and valueColumn must not be null
      IllegalArgumentException - keyColumn and valueColumn must be columns in swappableTable
      RuntimeException - the specified data types must match the data types of the corresponding columns
  • Method Details

    • 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