Package com.vladsch.flexmark.util.data
Class DataSet
java.lang.Object
com.vladsch.flexmark.util.data.DataSet
- All Implemented Interfaces:
DataHolder
,MutableDataSetter
- Direct Known Subclasses:
MutableDataSet
,ScopedDataSet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final HashMap
<DataKeyBase<?>, Object> private static final ArrayList
<DataKeyAggregator> Fields inherited from interface com.vladsch.flexmark.util.data.DataHolder
NULL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull DataHolder
Apply aggregate action to data and return resultstatic @NotNull DataHolder
aggregate
(@Nullable DataHolder other, @Nullable DataHolder overrides) Aggregate two sets of options by aggregating their aggregate action keys then applying those actions on the resulting collectionstatic @NotNull DataHolder
aggregateActions
(@NotNull DataHolder other, @NotNull DataHolder overrides) aggregate actions of two data sets, actions not appliedboolean
contains
(@NotNull DataKeyBase<?> key) boolean
@NotNull Map
<? extends DataKeyBase<?>, Object> getAll()
@NotNull Collection
<? extends DataKeyBase<?>> getKeys()
@Nullable Object
getOrCompute
(@NotNull DataKeyBase<?> key, @NotNull DataValueFactory<?> factory) Get key if it exists or compute using supplierint
hashCode()
(package private) static boolean
invokeSetContains
(@Nullable Set<Class<?>> invokeSet, @NotNull DataKeyAggregator aggregator) (package private) static boolean
isAggregatorRegistered
(@NotNull DataKeyAggregator keyAggregator) static @NotNull DataSet
merge
(@NotNull DataHolder... dataHolders) static void
registerDataKeyAggregator
(@NotNull DataKeyAggregator keyAggregator) @NotNull DataSet
@NotNull DataSet
@NotNull MutableDataSet
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 Details
-
dataSet
-
ourDataKeyAggregators
-
-
Constructor Details
-
DataSet
public DataSet() -
DataSet
-
-
Method Details
-
aggregateActions
@NotNull public static @NotNull DataHolder aggregateActions(@NotNull @NotNull DataHolder other, @NotNull @NotNull DataHolder overrides) aggregate actions of two data sets, actions not applied- Parameters:
other
- first set of optionsoverrides
- overrides on options- Returns:
- resulting options where aggregate action keys were aggregated but not applied
-
aggregate
Apply aggregate action to data and return result- Returns:
- resulting data holder
-
aggregate
@NotNull public static @NotNull DataHolder aggregate(@Nullable @Nullable DataHolder other, @Nullable @Nullable DataHolder overrides) Aggregate two sets of options by aggregating their aggregate action keys then applying those actions on the resulting collection- Parameters:
other
- options with aggregate actions already applied, no aggregate action keys are expected or checkedoverrides
- overrides which may contain aggregate actions- Returns:
- resulting options with aggregate actions applied and removed from set
-
getAll
- Specified by:
getAll
in interfaceDataHolder
-
getKeys
- Specified by:
getKeys
in interfaceDataHolder
-
contains
- Specified by:
contains
in interfaceDataHolder
-
getOrCompute
@Nullable public @Nullable 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
- Parameters:
key
- data keyfactory
- factory taking this data holder and computing/providing default value- Returns:
- object value for the key
-
merge
-
toMutable
- Specified by:
toMutable
in interfaceDataHolder
-
toImmutable
- Specified by:
toImmutable
in interfaceDataHolder
-
toDataSet
- Specified by:
toDataSet
in interfaceDataHolder
-
registerDataKeyAggregator
-
isAggregatorRegistered
-
invokeSetContains
static boolean invokeSetContains(@Nullable @Nullable Set<Class<?>> invokeSet, @NotNull @NotNull DataKeyAggregator aggregator) -
toString
-
equals
-
hashCode
public int hashCode()
-