public class MutableDataSet extends DataSet implements MutableDataHolder
Constructor and Description |
---|
MutableDataSet() |
MutableDataSet(DataHolder other) |
Modifier and Type | Method and Description |
---|---|
MutableDataHolder |
clear()
clear all options out of the data set
|
<T> T |
get(DataKey<T> key)
Get the given key, if it does not exist then use the key's factory to create a new value and put it into the collection
so that the following get of the same key will find a value
|
<T> T |
getOrCompute(DataKey<T> key,
DataValueFactory<T> factory)
Will return the value previously set or generate a new value using the given factory.
|
static MutableDataSet |
merge(DataHolder... dataHolders) |
<T> MutableDataSet |
remove(DataKey<T> key)
Remove the stored value for the key, used to force to default or to force recompute
|
<T> MutableDataSet |
set(DataKey<T> key,
T value)
Store the given value for the key
|
MutableDataSet |
setAll(DataHolder other)
Copy all values from one data holder to this data holder
|
MutableDataHolder |
setFrom(MutableDataSetter dataSetter)
Store the given value for the key
|
MutableDataHolder |
setIn(MutableDataHolder dataHolder)
Set options in gven mutable data hoer
|
DataHolder |
toImmutable() |
MutableDataSet |
toMutable() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, getAll, keySet
public MutableDataSet()
public MutableDataSet(DataHolder other)
public <T> MutableDataSet set(DataKey<T> key, T value)
MutableDataHolder
set
in interface MutableDataHolder
T
- data type of the data referred by the keykey
- data keyvalue
- value to storepublic MutableDataHolder setFrom(MutableDataSetter dataSetter)
MutableDataHolder
setFrom
in interface MutableDataHolder
dataSetter
- data setter which will set valuespublic MutableDataSet setAll(DataHolder other)
MutableDataHolder
setAll
in interface MutableDataHolder
other
- data holder from which to copy all valuespublic MutableDataHolder setIn(MutableDataHolder dataHolder)
MutableDataHolder
setIn
in interface MutableDataHolder
setIn
in interface MutableDataSetter
dataHolder
- data holder where to copy options from this data holderpublic <T> T get(DataKey<T> key)
MutableDataHolder
get
in interface DataHolder
get
in interface MutableDataHolder
get
in class DataSet
key
- data keypublic <T> MutableDataSet remove(DataKey<T> key)
MutableDataHolder
remove
in interface MutableDataHolder
T
- data type of the data referred by the keykey
- data key to removepublic <T> T getOrCompute(DataKey<T> key, DataValueFactory<T> factory)
MutableDataHolder
getOrCompute
in interface MutableDataHolder
T
- data type of the data referred by the keykey
- data key identifying the datafactory
- data value factory to use if the data referred by the key is not setpublic static MutableDataSet merge(DataHolder... dataHolders)
public MutableDataSet toMutable()
toMutable
in interface DataHolder
toMutable
in class DataSet
public DataHolder toImmutable()
toImmutable
in interface DataHolder
toImmutable
in class DataSet
public MutableDataHolder clear()
MutableDataHolder
clear
in interface MutableDataHolder
Copyright © 2017. All rights reserved.