Class IndexableDataWithDefault<T>

java.lang.Object
io.deephaven.plot.datasets.data.IndexableData<T>
io.deephaven.plot.datasets.data.IndexableDataWithDefault<T>
All Implemented Interfaces:
PlotExceptionCause, Serializable

public class IndexableDataWithDefault<T> extends IndexableData<T>
IndexableData with a default value for missing indices and nulls.
See Also:
  • Constructor Details

    • IndexableDataWithDefault

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

    • size

      public int size()
      Description copied from class: IndexableData
      Gets the size of this dataset.
      Specified by:
      size in class IndexableData<T>
      Returns:
      the size of this dataset
    • get

      public T get(int index)
      Description copied from class: IndexableData
      Gets the value at the given index.
      Specified by:
      get in class IndexableData<T>
      Parameters:
      index - index
      Returns:
      value of this dataset at index
    • setDefault

      public void setDefault(T v)
      Defines the default value for this dataset.
      Parameters:
      v - value
    • getDefaultValue

      public T getDefaultValue()
      Gets the default value for this dataset.
      Returns:
      default value for this dataset
    • setSpecific

      public <TT extends T> void setSpecific(IndexableData<TT> specificValues, boolean infinite)
      Sets this datasets indexed values. If infinite is true, null values are returned for out-of-bounds indices. If not, an exception will be thrown.
      Type Parameters:
      TT - type of the data in specificValues
      Parameters:
      specificValues - data
      infinite - if this dataset should return nulls for out-of-bounds indices.
    • set

      public void set(IndexableDataWithDefault<T> data)
      Sets this datasets values equal to the values in another dataset.
      Parameters:
      data - dataset to get values from.