PersistentHashMap<K extends Object, V> class
Null safety
A collection of key/value pairs which provides efficient retrieval of value by key.
This class implements a persistent map: extending this map with a new key/value pair does not modify an existing instance but instead creates a new instance.
Unlike Map, this class does not support null
as a key value and
implements only a functionality needed for a specific use case at the
core of the framework.
Underlying implementation uses a variation of hash array mapped trie data structure with compressed (bitmap indexed) nodes.
See also:
Constructors
- PersistentHashMap.empty()
-
Creates an empty hash map.
const
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
put(
K key, V value) → PersistentHashMap< K, V> -
If this map does not already contain the given
key
tovalue
mapping then create a new version of the map which contains all mappings from the current one plus the givenkey
tovalue
mapping. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
K key) → V? -
Returns value associated with the given
key
ornull
ifkey
is not in the map.