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
Returns an iterable of entries in the map.
Add an addend to the value for a given key.
The key to update the value of
The value to add to the current value
The updated value
Divide the value for a given key by a divisor.
The key to update the value of
The value to divide the current value by
The updated value
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
Multiply a multiplicand by the value for a given key.
The key to update the value of
The value to multiply the current value by
The updated value
Raise the value for a given key to an exponent.
The key to update the value of
The exponent to raise the current value to
The updated value
Take the _n_th root of the value for a given key.
The key to get the _n_th root of
The root to get
The nth root of the value for key
Square root of the value for a given key.
The key to get the square root of
The square root of the value for key
Subtract a subtrahend from the value for a given key.
The key to update the value of
The value to subtract from the current value
The updated value
Returns an iterable of values in the map
Generated using TypeDoc
A DefaultMap with methods for performing basic math operations that mutate the data.