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< ? map, Factory<V> >Set< ? factory})V> > -
Creates an empty SetMultimap with the keys held in
map
and the values in a collection built withfactory
. -
SetMultimap.fromEntries(Iterable<
MapEntry< entries, {Map<K, V> >K, Set< ? map, Factory<V> >Set< ? factory})V> > -
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< ? map, Factory<V> >Set< ? factory})V> > -
Creates a SetMultimap with the keys and values computed from
iterable
.factory -
SetMultimap.fromIterables(Iterable<
K> keys, Iterable<V> values, {Map<K, Set< ? map, Factory<V> >Set< ? factory})V> > -
factory
-
SetMultimap.identity({Factory<
Set< ? factory})V> > -
Creates a SetMultimap with identity keys.
factory
-
SetMultimap.of(Multimap<
K, V, Iterable< other, {Map<V> >K, Set< ? map, Factory<V> >Set< ? factory})V> > -
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
tovalue
.inherited -
addAll(
K key, Iterable< V> values) → void -
Adds associations from
key
to each ofvalues
.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
tovalue
.inherited -
removeAll(
K key, [Iterable< V> ? values]) → void -
Removes associations from
key
to each ofvalues
.inherited -
replace(
K key, V value) → void -
Replaces the
key
with a singlevalue
.inherited -
replaceAll(
K key, Iterable< V> values) → void -
Replaces the
key
with each of thevalues
.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