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 Details

  • Constructor Details

    • ScopedDataSet

      public ScopedDataSet(@Nullable @Nullable DataHolder parent)
    • ScopedDataSet

      public ScopedDataSet(@Nullable @Nullable DataHolder parent, @Nullable @Nullable DataHolder other)
  • Method Details

    • getParent

      public DataHolder getParent()
    • getAll

      @NotNull public @NotNull Map<? extends DataKeyBase<?>,Object> getAll()
      Specified by:
      getAll in interface DataHolder
      Overrides:
      getAll in class DataSet
    • getKeys

      @NotNull public @NotNull Collection<? extends DataKeyBase<?>> getKeys()
      Specified by:
      getKeys in interface DataHolder
      Overrides:
      getKeys in class DataSet
    • toMutable

      @NotNull public @NotNull MutableDataSet toMutable()
      Specified by:
      toMutable in interface DataHolder
      Overrides:
      toMutable in class DataSet
    • contains

      public boolean contains(@NotNull @NotNull DataKeyBase<?> key)
      Specified by:
      contains in interface DataHolder
      Overrides:
      contains in class DataSet
    • 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 supplier

      Method 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 interface DataHolder
      Overrides:
      getOrCompute in class DataSet
      Parameters:
      key - data key
      factory - factory taking this data holder and computing/providing default value
      Returns:
      object value for the key