Class AssociativeDataWithDefault<KEY,VALUE>
java.lang.Object
com.illumon.iris.db.plot.datasets.data.AssociativeData<KEY,VALUE>
com.illumon.iris.db.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:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description AssociativeDataWithDefault(PlotInfo plotInfo)
-
Method Summary
Modifier and Type Method Description VALUE
get(KEY key)
Gets the value associated with the keyVALUE
getDefault()
Gets the default value for this dataset.AssociativeData<KEY,VALUE>
getSpecific()
Gets this dataset's key-value pairs as anAssociativeData
dataset.boolean
isModifiable()
Whether the dataset is modifiable.void
onClose()
Tear down once a figure is removed.void
put(KEY key, VALUE value)
Adds the key-value pair to the dataset.<K extends KEY, V extends VALUE>
voidputAll(Map<K,V> values)
Adds all key-value pairs in the map to the dataset.void
set(AssociativeDataWithDefault<KEY,VALUE> data)
Sets this dataset's values equal to the values in another dataset.void
setDefault(VALUE value)
Defines the default value for this dataset.void
setSpecific(AssociativeData<KEY,VALUE> provider)
Sets this dataset's key-value pairs.Methods inherited from class com.illumon.iris.db.plot.datasets.data.AssociativeData
getPlotInfo, snapshot
-
Constructor Details
-
AssociativeDataWithDefault
- Parameters:
plotInfo
- plot information
-
-
Method Details
-
getDefault
Gets the default value for this dataset.- Returns:
- default value for this dataset
-
setDefault
Defines the default value for this dataset.- Parameters:
value
- default value
-
getSpecific
Gets this dataset's key-value pairs as anAssociativeData
dataset.- Returns:
AssociativeData
dataset representing this datasets key-value pairs
-
setSpecific
Sets this dataset's key-value pairs.- Parameters:
provider
- dataset holding key-value pairs
-
get
Description copied from class:AssociativeData
Gets the value associated with the key- Specified by:
get
in classAssociativeData<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 classAssociativeData<KEY,VALUE>
- Returns:
- true if the dataset is modifiable, false if not
-
put
Description copied from class:AssociativeData
Adds the key-value pair to the dataset.- Specified by:
put
in classAssociativeData<KEY,VALUE>
- Parameters:
key
- keyvalue
- value
-
putAll
Description copied from class:AssociativeData
Adds all key-value pairs in the map to the dataset.- Specified by:
putAll
in classAssociativeData<KEY,VALUE>
- Type Parameters:
K
- type of the keys invalues
V
- type of the values invalues
- Parameters:
values
- keypair map
-
set
Sets this dataset's values equal to the values in another dataset.- Parameters:
data
- dataset to get values from.
-
onClose
public void onClose()Description copied from class:AssociativeData
Tear down once a figure is removed.- Overrides:
onClose
in classAssociativeData<KEY,VALUE>
-