SetMultimap< K, V> class
A multimap implementation that uses Sets to store the values associated with each key.
Constructors
- SetMultimap()
- SetMultimap.fromIterable(Iterable iterable, { K key(dynamic element), V value(dynamic element) })
-
Constructs a new set-backed multimap. For each element e of
iterable
, adds an association from key to value.key
andvalue
each default to the identity function.
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- isEmpty → bool
-
Returns true if there is no key in the multimap.
read-only, inherited
- isNotEmpty → bool
-
Returns true if there is at least one key in the multimap.
read-only, inherited
-
keys
→ Iterable<
K> -
The keys of this.
read-only, inherited
- length → int
-
The number of keys in the multimap.
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
-
values
→ Iterable<
V> -
The values of this.
read-only, inherited
Methods
-
asMap(
) → Map< K, Set< V>> -
Returns a view of this multimap as a map.
override
-
removeAll(
Object key) → Set< V> -
Removes the association for the given
key
. Returns the collection of removed values, or an empty iterable ifkey
was unmapped. -
add(
K key, V value) → void -
Adds an association from the given key to the given value.
inherited
-
addAll(
Multimap< K, V> other) → void -
Adds all associations of
other
to this multimap. [...]inherited -
addValues(
K key, Iterable< V> values) → void -
Adds an association from the given key to each of the given values.
inherited
-
clear(
) → void -
Removes all data from the multimap.
inherited
-
contains(
Object key, Object value) → bool -
Returns whether this multimap contains the given association between
key
andvalue
.inherited -
containsKey(
Object key) → bool -
Returns whether this multimap contains the given
key
.inherited -
containsValue(
Object value) → bool -
Returns whether this multimap contains the given
value
.inherited -
forEach(
void f(K key, V value)) → void -
Applies
f
to each {key, value} pair of the multimap. [...]inherited -
forEachKey(
void f(K key, C value)) → void -
Applies
f
to each {key,Iterable<value>
} pair of the multimap. [...]inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
remove(
Object key, V value) → bool -
Removes the association between the given
key
andvalue
. Returnstrue
if the association existed,false
otherwise.inherited -
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator [](
Object key) → Set< V> -
Returns the values for the given
key
. An empty iterable is returned ifkey
is not mapped. The returned collection is a view on the multimap. Updates to the collection modify the multimap and likewise, modifications to the multimap are reflected in the returned collection. -
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited