SetMultimap<K, V> class

A multimap that stores values in a Set, and that keeps the unique values of a given key. A factory can be provided to create custom value collections.

Constructors

SetMultimap({Map<K, Set<V>>? map, Factory<Set<V>>? factory})
Creates an empty SetMultimap with the keys held in map and the values in a collection built with factory.
SetMultimap.fromEntries(Iterable<MapEntry<K, V>> entries, {Map<K, Set<V>>? map, Factory<Set<V>>? factory})
Creates a SetMultimap containing the entries of entries.
factory
SetMultimap.fromIterable(Iterable<Object?> iterable, {K key(Object? element)?, V value(Object? element)?, Map<K, Set<V>>? map, Factory<Set<V>>? factory})
Creates a SetMultimap with the keys and values computed from iterable.
factory
SetMultimap.fromIterables(Iterable<K> keys, Iterable<V> values, {Map<K, Set<V>>? map, Factory<Set<V>>? factory})
factory
SetMultimap.identity({Factory<Set<V>>? factory})
Creates a SetMultimap with identity keys.
factory
SetMultimap.of(Multimap<K, V, Iterable<V>> other, {Map<K, Set<V>>? map, Factory<Set<V>>? factory})
Creates a SetMultimap 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, Set<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) → SetMultimapValues<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) Set<V>
Returns the values for the given key.
inherited