ListMultimap<K, V> class

A multimap that stores values in a List, and that maintains the insertion order of values of a given key. A factory can be provided to create custom value collections.

Constructors

ListMultimap({Map<K, List<V>>? map, Factory<List<V>>? factory})
Creates an empty ListMultimap with the keys held in map and the values in a collection built with factory.
ListMultimap.fromEntries(Iterable<MapEntry<K, V>> entries, {Map<K, List<V>>? map, Factory<List<V>>? factory})
Creates a ListMultimap containing the entries of entries.
factory
ListMultimap.fromIterable(Iterable<Object?> iterable, {K key(Object? element)?, V value(Object? element)?, Map<K, List<V>>? map, Factory<List<V>>? factory})
Creates a ListMultimap with the keys and values from iterable.
factory
ListMultimap.fromIterables(Iterable<K> keys, Iterable<V> values, {Map<K, List<V>>? map, Factory<List<V>>? factory})
factory
ListMultimap.identity({Factory<List<V>>? factory})
Creates a ListMultimap with identity keys.
factory
ListMultimap.of(Multimap<K, V, Iterable<V>> other, {Map<K, List<V>>? map, Factory<List<V>>? factory})
Creates a ListMultimap with the same keys and values as other.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns true if there are no values in this multimap.
no setterinherited
isNotEmpty bool
Returns true if there is at leas one value in this multimap.
no setterinherited
keys Iterable<K>
The unique keys of this multimap.
no setterinherited
length int
Returns the total number of values in this multimap.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Iterable<V>
The values of this multimap.
no setterinherited

Methods

add(K key, V value) → void
Adds an association from key to value.
inherited
addAll(K key, Iterable<V> values) → void
Adds associations from key to each of values.
inherited
asMap() Map<K, List<V>>
Returns a mutable view onto the underlying map.
inherited
clear() → void
Removes all values from this multimap.
inherited
containsKey(K? key) bool
Returns true if this map contains the given key.
inherited
containsValue(V? value) bool
Returns true if this map contains the given value.
inherited
forEach(void callback(K key, V value)) → void
Applies callback to each key/value of this multimap.
inherited
lookupValues(K key) → ListMultimapValues<K, V>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(K key, V value) → void
Removes one association from key to value.
inherited
removeAll(K key, [Iterable<V>? values]) → void
Removes associations from key to each of values.
inherited
replace(K key, V value) → void
Replaces the key with a single value.
inherited
replaceAll(K key, Iterable<V> values) → void
Replaces the key with each of the values.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](K key) List<V>
Returns the values for the given key.
inherited