Package com.vladsch.flexmark.util.data
Class MutableScopedDataSet
- java.lang.Object
-
- com.vladsch.flexmark.util.data.DataSet
-
- com.vladsch.flexmark.util.data.MutableDataSet
-
- com.vladsch.flexmark.util.data.MutableScopedDataSet
-
- All Implemented Interfaces:
DataHolder,MutableDataHolder,MutableDataSetter
public class MutableScopedDataSet extends MutableDataSet
-
-
Field Summary
Fields Modifier and Type Field Description protected DataHolderparent-
Fields inherited from interface com.vladsch.flexmark.util.data.DataHolder
NULL
-
-
Constructor Summary
Constructors Constructor Description MutableScopedDataSet(DataHolder parent)MutableScopedDataSet(DataHolder parent, MutableDataHolder other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(@NotNull DataKeyBase<?> key)@NotNull Map<? extends DataKeyBase<?>,Object>getAll()@NotNull Collection<? extends DataKeyBase<?>>getKeys()@Nullable ObjectgetOrCompute(@NotNull DataKeyBase<?> key, @NotNull DataValueFactory<?> factory)Get key if it exists or compute using supplierDataHoldergetParent()-
Methods inherited from class com.vladsch.flexmark.util.data.MutableDataSet
clear, merge, remove, set, set, setAll, setFrom, setIn, toDataSet, toImmutable, toMutable
-
Methods inherited from class com.vladsch.flexmark.util.data.DataSet
aggregate, aggregate, aggregateActions, equals, hashCode, registerDataKeyAggregator, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.vladsch.flexmark.util.data.MutableDataHolder
get
-
-
-
-
Field Detail
-
parent
protected final DataHolder parent
-
-
Constructor Detail
-
MutableScopedDataSet
public MutableScopedDataSet(DataHolder parent)
-
MutableScopedDataSet
public MutableScopedDataSet(DataHolder parent, MutableDataHolder other)
-
-
Method Detail
-
getParent
public DataHolder getParent()
-
getAll
@NotNull public @NotNull Map<? extends DataKeyBase<?>,Object> getAll()
- Specified by:
getAllin interfaceDataHolder- Overrides:
getAllin classDataSet
-
getKeys
@NotNull public @NotNull Collection<? extends DataKeyBase<?>> getKeys()
- Specified by:
getKeysin interfaceDataHolder- Overrides:
getKeysin classDataSet
-
contains
public boolean contains(@NotNull @NotNull DataKeyBase<?> key)- Specified by:
containsin interfaceDataHolder- Overrides:
containsin classDataSet
-
getOrCompute
@Nullable public @Nullable Object getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @NotNull DataValueFactory<?> factory)
Description copied from interface:DataHolderGet key if it exists or compute using supplierMethod used by DataKey classes to access data.
NOTE: MutableDataHolders will compute an absent key and add it to its dataSet. DataHolders will return computed value but not change contained dataSet because they are immutable. So value will be computed every time it is requested.
- Specified by:
getOrComputein interfaceDataHolder- Specified by:
getOrComputein interfaceMutableDataHolder- Overrides:
getOrComputein classMutableDataSet- Parameters:
key- data keyfactory- factory taking this data holder and computing/providing default value- Returns:
- object value for the key
-
-