computeIfAbsent


Description:

public static V computeIfAbsent<K,V> (HashMap<K,V> map, K key, owned SupplierFunc<V> fn)

Returns the value for the key. If absent, computes value with fn, stores it, and returns it.

Parameters:

map

the map to query and update.

key

the key to look up.

fn

supplier function for missing values.

Returns:

existing or computed value.