Create a new DefaultMap
with a specified default value.
Time complexity: O(n)
Space complexity: O(n)
The default value to use for missing keys
Create a new DefaultMap
with a specified function to generate default values.
Time complexity: O(n)
Space complexity: O(n)
The function to generate default values
If the default value is a function.
Returns an iterable of entries in the map.
Returns an iterable of key, value pairs for every entry in the map.
Get the value for a given key, or the default value if it's missing.
Time complexity: O(1)
Space complexity: O(1)
The key to get the value for
The value for key
, or the default value if it's missing
Returns an iterable of keys in the map
Returns an iterable of values in the map
Generated using TypeDoc
A
Map
that has a default value for missing keys.