MutHashMap
Definitions
Updates the value at key k using function f if the key exists.
Does nothing if the key does not exist.
def adjustWithKey(f: k -> (v -> v \ ef), k: k, m: MutHashMap[k, v, r]): Unit \ ef + r with Eq[k], Hash[k]§ SourceUpdates the value at key k using function f with key if the key exists.
Does nothing if the key does not exist.
def copy(rc: Region[r2], m: MutHashMap[k, v, r1]): MutHashMap[k, v, r2] \ r1 + r2 with Eq[k], Hash[k]§ SourceReturns a shallow copy of m in region rc2.
All key-value pairs are copied in insertion order.
Returns the number of key-value pairs in m that satisfy the predicate f.
Returns an empty mutable hash map with the given capacity.
The capacity is rounded up to the minimum capacity.
Returns true if at least one key-value pair in m satisfies the predicate f.
Returns the first key-value pair in m (in insertion order) that satisfies the predicate f.
Alias for findLeft.
Returns the first key-value pair in m (from left, in insertion order) that satisfies the predicate f.
Returns the first key-value pair in m (from right, in reverse insertion order) that satisfies the predicate f.
Returns the first key-value pair that was inserted into the mutable map m.
Returns None if the map is empty.
Returns the first key that was inserted into the mutable map m.
Returns None if the map is empty.
Returns the first value that was inserted into the mutable map m.
Returns None if the map is empty.
Applies f to a start value s and all values in m going from left to right (insertion order).
Applies f to a start value s and all key-value pairs in m going from left to right (insertion order).
Returns the result of mapping each value and combining the results using a monoid.
Applies f to a start value s and all values in m going from right to left (reverse insertion order).
def foldRightWithKey(f: k -> (v -> (b -> b \ ef)), s: b, m: MutHashMap[k, v, r]): b \ ef + r§ SourceApplies f to a start value s and all key-value pairs in m going from right to left (reverse insertion order).
Returns true if all key-value pairs in m satisfy the predicate f.
Applies f to each key-value pair in m in insertion order.
def forEachWithIndex(f: Int32 -> (k -> (v -> Unit \ ef)), m: MutHashMap[k, v, r]): Unit \ ef + r§ SourceApplies f to each key-value pair in m along with its index in insertion order.
Returns a new mutable hash map containing all key-value pairs from list l.
If the list contains duplicate keys, the last occurrence wins.
Returns a new mutable hash map containing all key-value pairs from immutable map m.
Returns Some(v) if key k exists in m, otherwise None.
Returns the value associated with key k in the mutable hash map m.
Aborts if the key is not present.
Returns the value associated with key k in m.
If k does not exist, inserts k with value default and returns default.
Returns the value associated with key k, or default if not found.
Returns an iterator over key-value pairs in m in insertion order.
Returns an iterator over keys in m in insertion order.
def iteratorValues(rc: Region[r2], m: MutHashMap[k, v, r]): Iterator[v, r2 + r, r2] \ r + r2§ SourceReturns an iterator over values in m in insertion order.
Returns a string formed by joining all keys in m with sep.
Returns a string formed by joining all values in m with sep.
def joinWith(f: k -> (v -> String \ ef), sep: String, m: MutHashMap[k, v, r]): String \ ef + r§ SourceReturns a string formed by applying f to each key-value pair and joining with sep.
Returns the set of all keys in m.
Returns the last key-value pair that was inserted into the mutable map m.
Returns None if the map is empty.
Returns the last key that was inserted into the mutable map m.
Returns None if the map is empty.
Returns the last value that was inserted into the mutable map m.
Returns None if the map is empty.
def map(rc: Region[r2], f: v1 -> v2 \ ef, m: MutHashMap[k, v1, r1]): MutHashMap[k, v2, r2] \ ef + r1 + r2 with Eq[k], Hash[k]§ SourceReturns a new mutable hash map with values transformed by function f.
Keys and insertion order are preserved.
def mapWithKey(rc: Region[r2], f: k -> (v1 -> v2 \ ef), m: MutHashMap[k, v1, r1]): MutHashMap[k, v2, r2] \ ef + r1 + r2 with Eq[k], Hash[k]§ SourceReturns a new mutable hash map with values transformed by function f with access to keys.
Keys and insertion order are preserved.
Returns true if key k exists in m.
Inserts key k with value v into m.
If the key already exists, updates its value (does not change insertion order).
def putAll(kvs: f[(k, v)], m: MutHashMap[k, v, r]): Unit \ r + Aef[f] with Eq[k], Hash[k], Foldable[f]§ SourceAdds all key-value pairs in the collection kvs to the mutable map m.
def putWith(f: v -> (v -> v \ ef), k: k, v: v, m: MutHashMap[k, v, r]): Unit \ ef + r with Eq[k], Hash[k]§ SourceInserts key k with value v into m, using combiner function f if key exists.
If key exists with value oldV, updates to f(v, oldV).
Otherwise, inserts k => v.
def putWithKey(f: k -> (v -> (v -> v \ ef)), k: k, v: v, m: MutHashMap[k, v, r]): Unit \ ef + r with Eq[k], Hash[k]§ SourceInserts key k with value v into m, using combiner function f with key if key exists.
If key exists with value oldV, updates to f(k, v, oldV).
Otherwise, inserts k => v.
Removes all entries from m where f(value) returns false.
def refineWithKey(f: k -> (v -> Bool \ ef), m: MutHashMap[k, v, r]): Unit \ ef + r with Eq[k], Hash[k]§ SourceRemoves all entries from m where f(key, value) returns false.
Returns a mutable hash map with a single key-value pair k => v.
Returns an array of all key-value pairs in m in insertion order.
Returns a list of all key-value pairs in m in insertion order.
Returns an immutable map containing all key-value pairs from m.
Returns a set containing all key-value pairs from m.
Returns a string representation of m.
Returns a vector of all key-value pairs in m in insertion order.
Transforms all values in m in-place using function f.
Transforms all values in m in-place using function f with access to keys.
def update(f: v -> Option[v] \ ef, k: k, m: MutHashMap[k, v, r]): Unit \ ef + r with Eq[k], Hash[k]§ SourceUpdates or removes the value at key k based on function f.
If key exists and f(oldValue) = Some(newValue), updates to newValue.
If key exists and f(oldValue) = None, removes the entry.
Does nothing if the key does not exist.
def updateWithKey(f: k -> (v -> Option[v] \ ef), k: k, m: MutHashMap[k, v, r]): Unit \ ef + r with Eq[k], Hash[k]§ SourceUpdates or removes the value at key k based on function f with key.
If key exists and f(k, oldValue) = Some(newValue), updates to newValue.
If key exists and f(k, oldValue) = None, removes the entry.
Does nothing if the key does not exist.