Package com.vladsch.flexmark.util.data
Class ScopedDataSet
- java.lang.Object
-
- com.vladsch.flexmark.util.data.DataSet
-
- com.vladsch.flexmark.util.data.ScopedDataSet
-
- All Implemented Interfaces:
DataHolder
,MutableDataSetter
public class ScopedDataSet extends DataSet
-
-
Field Summary
Fields Modifier and Type Field Description protected DataHolder
parent
-
Fields inherited from interface com.vladsch.flexmark.util.data.DataHolder
NULL
-
-
Constructor Summary
Constructors Constructor Description ScopedDataSet(@Nullable DataHolder parent)
ScopedDataSet(@Nullable DataHolder parent, @Nullable DataHolder other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(@NotNull DataKeyBase<?> key)
@NotNull java.util.Map<? extends DataKeyBase<?>,java.lang.Object>
getAll()
@NotNull java.util.Collection<? extends DataKeyBase<?>>
getKeys()
@Nullable java.lang.Object
getOrCompute(@NotNull DataKeyBase<?> key, @NotNull DataValueFactory<?> factory)
Get key if it exists or compute using supplierDataHolder
getParent()
@NotNull MutableDataSet
toMutable()
-
Methods inherited from class com.vladsch.flexmark.util.data.DataSet
aggregate, aggregate, aggregateActions, equals, hashCode, invokeSetContains, isAggregatorRegistered, merge, registerDataKeyAggregator, toDataSet, toImmutable, 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.DataHolder
get, setIn
-
-
-
-
Field Detail
-
parent
protected final DataHolder parent
-
-
Constructor Detail
-
ScopedDataSet
public ScopedDataSet(@Nullable @Nullable DataHolder parent)
-
ScopedDataSet
public ScopedDataSet(@Nullable @Nullable DataHolder parent, @Nullable @Nullable DataHolder other)
-
-
Method Detail
-
getParent
public DataHolder getParent()
-
getAll
@NotNull public @NotNull java.util.Map<? extends DataKeyBase<?>,java.lang.Object> getAll()
- Specified by:
getAll
in interfaceDataHolder
- Overrides:
getAll
in classDataSet
-
getKeys
@NotNull public @NotNull java.util.Collection<? extends DataKeyBase<?>> getKeys()
- Specified by:
getKeys
in interfaceDataHolder
- Overrides:
getKeys
in classDataSet
-
toMutable
@NotNull public @NotNull MutableDataSet toMutable()
- Specified by:
toMutable
in interfaceDataHolder
- Overrides:
toMutable
in classDataSet
-
contains
public boolean contains(@NotNull @NotNull DataKeyBase<?> key)
- Specified by:
contains
in interfaceDataHolder
- Overrides:
contains
in classDataSet
-
getOrCompute
@Nullable public @Nullable java.lang.Object getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @NotNull DataValueFactory<?> factory)
Description copied from interface:DataHolder
Get 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:
getOrCompute
in interfaceDataHolder
- Overrides:
getOrCompute
in classDataSet
- Parameters:
key
- data keyfactory
- factory taking this data holder and computing/providing default value- Returns:
- object value for the key
-
-