Interface LazySortedMap<K,V>

Type Parameters:
K - The type of keys maintained by this map.
V - The type of mapped values.
All Superinterfaces:
LazyMap<K,V>, Map<K,V>, SequencedMap<K,V>, SortedMap<K,V>
All Known Implementing Classes:
LazySortedMapImpl

@ClassVersion(sourceVersion="$Id: LazySortedMap.java 1032 2022-04-10 17:27:44Z tquadrat $") @API(status=STABLE, since="0.0.5") public sealed interface LazySortedMap<K,V> extends LazyMap<K,V>, SortedMap<K,V> permits LazySortedMapImpl<K,V>
The interface for a SortedMap that will be initialised only when required.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: LazySortedMap.java 1032 2022-04-10 17:27:44Z tquadrat $
Since:
0.0.5
See Also:
UML Diagram
UML Diagram for "org.tquadrat.foundation.util.LazySortedMap"

UML Diagram for "org.tquadrat.foundation.util.LazySortedMap"

UML Diagram for "org.tquadrat.foundation.util.LazySortedMap"
  • Method Details

    • of

      @API(status=STABLE, since="0.0.5") static <K, V> LazySortedMap<K,V> of(SortedMap<K,V> value)
      Creates a new LazySortedMap instance that is already initialised.
      Type Parameters:
      K - The type of keys maintained by this map.
      V - The type of mapped values.
      Parameters:
      value - The value.
      Returns:
      The new instance.
    • use

      @API(status=STABLE, since="0.0.5") static <K, V> LazySortedMap<K,V> use(Supplier<? extends SortedMap<K,V>> supplier)
      Creates a new LazySortedMap instance that uses the given supplier to create the internal map, but that supplier will not populate the map with entries.
      Type Parameters:
      K - The type of keys maintained by this map.
      V - The type of mapped values.
      Parameters:
      supplier - The supplier that initialises the new instance of LazySortedMap when needed.
      Returns:
      The new instance.
    • use

      @API(status=STABLE, since="0.0.5") static <K, V> LazySortedMap<K,V> use(boolean doPopulate, Supplier<? extends SortedMap<K,V>> supplier)
      Creates a new LazySortedMap instance that uses the given supplier to initialise.
      Type Parameters:
      K - The type of keys maintained by this map.
      V - The type of mapped values.
      Parameters:
      doPopulate - true if the provided supplier will put values to the map on initialisation, false if it will create an empty map.
      supplier - The supplier that initialises the new instance of LazySortedMap when needed.
      Returns:
      The new instance.