IMapOfSetsConst<K, V> class

Inheritance

Constructors

IMapOfSetsConst(IMap<K, ISet<V>> _mapOfSets, [ConfigMapOfSets config = const ConfigMapOfSets()])
To create an empty constant IMapOfSets: const IMapOfSetsConst(IMapConst({})).
const

Properties

config ConfigMapOfSets
The map-of-sets configuration.
finalinherited
configMap ConfigMap
The internal IMap configuration.
no setterinherited
configSet ConfigSet
The internal ISet configuration.
no setterinherited
entries Iterable<MapEntry<K, ISet<V>>>
Return iterable of entries, where each entry is the key:set pair.
no setterinherited
entriesAsSet ISet<MapEntry<K, ISet<V>>>
Returns an ISet of the MapEntry's.
no setterinherited
flush IMapOfSets<K, V>
Flushes this collection, if necessary. Chainable method.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isDeepEquals bool
See also: ConfigMapOfSets
no setterinherited
isEmpty bool
Returns true if there are no elements in this collection.
no setterinherited
isFlushed bool
Whether this collection is already flushed or not.
no setterinherited
isIdentityEquals bool
See also: ConfigMapOfSets
no setterinherited
isNotEmpty bool
Returns true if there is at least one element in this collection.
no setterinherited
keys Iterable<K>
Returns an Iterable of the map keys.
no setterinherited
keysAsList IList<K>
Return all keys.
no setterinherited
keysAsSet ISet<K>
Returns an ISet of the keys.
no setterinherited
lengthOfKeys int
The number of keys.
no setterinherited
lengthOfNonRepeatingValues int
The sum of the number of unique values of all sets.
no setterinherited
lengthOfValues int
The sum of the number of values of all sets.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sets Iterable<ISet<V>>
Returns an Iterable of the map values.
no setterinherited
setsAsList IList<ISet<V>>
Returns a list of the internal sets.
no setterinherited
setsAsSet ISet<ISet<V>>
Returns an ISet of the internal sets.
no setterinherited
unlock Map<K, Set<V>>
Unlocks the map, returning a regular (mutable, ordered) Map<K, Set<V> of type LinkedHashMap. This map is "safe", in the sense that is independent from the original IMap.
no setterinherited
values Iterable<V>
Return all values of all sets, in order, including duplicates.
no setterinherited
valuesAsSet ISet<V>
Return all values of all sets, removing duplicates.
no setterinherited

Methods

add(K key, V value) IMapOfSets<K, V>
Find the key/set entry, and add the value to the set. If the key doesn't exist, will first create it with an empty set, and then add the value to it. If the value already exists in the set, nothing happens.
inherited
addEntries(Iterable<MapEntry<K, Set<V>>> entries) IMapOfSets<K, V>
Adds all set values to this map.
inherited
addIMap(IMap<K, Set<V>> map) IMapOfSets<K, V>
Adds all set values to this map.
inherited
addMap(Map<K, Set<V>> map) IMapOfSets<K, V>
Adds all set values to this map.
inherited
addValues(K key, Iterable<V> values) IMapOfSets<K, V>
Find the key/set entry, and add all the values to the set. If the key doesn't exist, will first create it with an empty set, and then add the values to it.
inherited
addValuesToKeys(Iterable<K> keys, Iterable<V> values) IMapOfSets<K, V>
Add all values to each set of all given keys. If the key doesn't exist, it will first create it with an empty set, and then add the values to it.
inherited
allEntriesWithValue(V value) Set<MapEntry<K, ISet<V>>>
Return any key:set entry where the value exists in the set. If that entry doesn't exist, return null.
inherited
allKeysWithValue(V value) Set<K>
Returns a Set of the keys which contain value.
inherited
asIMap() IMap<K, ISet<V>>
Returns this IMapOfSets<K, V> as an IMap<K, ISet<V>>.
inherited
cast<RK, RV>() IMapOfSets<RK, RV>
Provides a view of this map of sets as having RK keys and RV instances, if necessary.
inherited
clear() IMapOfSets<K, V>
If removeEmptySets is true, returns an empty map of sets with the same configuration. However, if removeEmptySets is false, keep the keys, but make their sets empty.
inherited
clearSet(K key) IMapOfSets<K, V>
When removeEmptySets is true, the given key and its corresponding set will be removed. This is the same as calling removeSet.
inherited
contains(K key, V value) bool
Return true if the given key entry exists, and its set contains the given value.
inherited
containsKey(K? key) bool
Return true if the given key exists.
inherited
containsValue(V value) bool
Return true if the value exists in any of the sets.
inherited
entry(K key) MapEntry<K, ISet<V>?>
Return the MapEntry for the given key. For key/value pairs that don't exist, it will return MapEntry(key, null);.
inherited
entryOrNull(K key) MapEntry<K, ISet<V>>?
Return the MapEntry for the given key. For key/value pairs that don't exist, it will return null.
inherited
equalItems(covariant Iterable<MapEntry> other) bool
Will return true only if the ISet has the same number of items as the iterable, and the ISet items are equal to the iterable items, in whatever order. This may be slow for very large sets, since it compares each item, one by one.
inherited
equalItemsAndConfig(IMapOfSets other) bool
Will return true only if the list items are equal, and the map of sets configurations (ConfigMapOfSets) are equal. This may be slow for very large maps, since it compares each item, one by one.
inherited
equalItemsToIMap<RK, RV>(IMap<RK, ISet<RV>> other) bool
Will return true only if the two maps have the same number of entries, and if the entries of the two maps are pairwise equal on both key and value.
inherited
equalItemsToIMapOfSets(IMapOfSets other) bool
Will return true only if the two maps have the same number of entries, and if the entries of the two maps are pairwise equal on both key and value.
inherited
firstValueWhere(bool test(V), {V orElse()?}) → V
Iterates through all values of all sets, and returns the first value it finds that satisfies test.
inherited
firstValueWhereOrNull(bool test(V), {V? orElse()?}) → V?
Iterates through all values of all sets, and returns the first value it finds that satisfies test.
inherited
flatten() Iterable<MapEntry<K, V>>
Return a flattened iterable of <K, V> entries (including eventual duplicates), where each entry is a key:value pair. For example, if the map is {1: {a, b}, 2: {x, y}}, it will return (1:a), (1:b), (2:x), (2:y).
inherited
forEach(void f(K key, ISet<V> set)) → void
Applies the function f to each element.
inherited
get(K key) ISet<V>
Return the set for the given key. If the key doesn't exist, return an empty set (never return null).
inherited
getEntryWithValue(V value) MapEntry<K, ISet<V>>?
Return any key:set entry where the value exists in the set. If that entry doesn't exist, return null.
inherited
getKeyWithValue(V value) → K?
Return any key entry where the value exists in its set. If it doesn't find the value, return null.
inherited
getOrNull(K key) ISet<V>?
Return the set for the given key. If the key doesn't exist, return null.
inherited
invertKeysAndValues([ConfigMapOfSets? config]) IMapOfSets<V, K>
Return a map where the keys are the values, and the values are the keys. Keys of empty sets will be removed. You can pass a new config for the map.
inherited
invertKeysAndValuesKeepingNullKeys([ConfigMapOfSets? config]) IMapOfSets<V?, K>
Return a map where the keys are the values, and the values are the keys. Empty sets will become the key null. You can pass a new config for the map.
inherited
isEmptyForKey(K key) bool
Return true if the value set is empty or null, for the given key. Return false if there are 1 or more values, for the given key.
inherited
isNotEmptyForKey(K key) bool
Return true if there are 1 or more values, for the given key. Return false if the value set is empty or null, for the given key.
inherited
keyList({ConfigList? config}) IList<K>
Returns an IList of the map keys. Optionally, you may provide a config for the list.
inherited
map<RK, RV>(MapEntry<RK, ISet<RV>> mapper(K key, ISet<V> set), {ConfigMapOfSets? config}) IMapOfSets<RK, RV>
Returns a new map where all entries of this map are transformed by the given mapper function. You may provide a config, otherwise it will be the same as the original map.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(K key, V value) IMapOfSets<K, V>
Find the key/set entry, and remove the value from the set. If the key doesn't exist, don't do anything. If the set becomes empty and removeEmptySets is true, the key will be removed entirely. Otherwise, the key will be kept and the set will be empty (not null).
inherited
removeSet(K key) IMapOfSets<K, V>
Remove the given key, if it exists, and its corresponding set. If the key doesn't exist, don't do anything.
inherited
removeValues(List<V> values, {Output<int>? numberOfRemovedValues}) IMapOfSets<K, V>
Remove all given values from all sets. If a set becomes empty and removeEmptySets is true, its key will be removed entirely. Otherwise, its key will be kept and the set will be empty (not null). If you want, you can pass numberOfRemovedValues to get the number of removed values.
inherited
removeValuesFromKeyWhere(K key, bool test(V value)) IMapOfSets<K, V>
Remove, from the given key set, all values that satisfy the given test. If the set becomes empty, the key will be removed entirely.
inherited
removeValuesWhere(bool test(K key, V value), {Output<int>? numberOfRemovedValues}) IMapOfSets<K, V>
Remove, from all sets, all given values that satisfy the given test. If a set becomes empty, its key will be removed entirely. If you want, you can pass numberOfRemovedValues to get the number of removed values.
inherited
removeWhere(bool predicate(K key, ISet<V> set)) IMapOfSets<K, V>
Removes all entries (key:set pair) of this map that satisfy the given predicate.
inherited
replaceSet(K key, ISet<V> set) IMapOfSets<K, V>
  • When removeEmptySets is true: If the given set is not empty, add the key/set entry. If the key already exists, replace it with the new set entirely. If the given set is empty, the key/set entry will be removed (same as calling removeSet).

  • When removeEmptySets is false: Add the key/set entry. If the key already exists, replace it with the new set entirely.

  • inherited
    same(IMapOfSets<K, V> other) bool
    Will return true only if the maps internals are the same instances (comparing by identity). This will be fast even for very large maps, since it doesn't compare each entry.
    inherited
    toggle(K key, V value, {bool? state}) IMapOfSets<K, V>
    Removes the value from the set of the corresponding key, if it exists in the set. Otherwise, adds it to the set. If the key doesn't exist, it will be created and then have the new value added to the new, corresponding set.
    inherited
    toString([bool? prettyPrint]) String
    Returns a string representation of (some of) the elements of this.
    inherited
    update(K key, ISet<V> update(ISet<V> set), {ISet<V> ifAbsent()?, Output<ISet<V>>? previousSet}) IMapOfSets<K, V>
    Updates the set for the provided key.
    inherited
    updateAll(ISet<V> update(K key, ISet<V> set)) IMapOfSets<K, V>
    Updates all sets.
    inherited
    valueList({ConfigList? config}) IList<V>
    Returns an IList of the all values in all sets.
    inherited
    withConfig(ConfigMapOfSets config) IMapOfSets<K, V>
    Creates a new map-of-sets with the given config (ConfigMapOfSets).
    inherited

    Operators

    operator ==(Object other) bool
  • If isDeepEquals configuration is true: Will return true only if the map entries are equal (not necessarily in the same order), and the map configurations are equal. This may be slow for very large maps, since it compares each entry, one by one.

  • If isDeepEquals configuration is false: Will return true only if the maps internals are the same instances (comparing by identity). This will be fast even for very large maps, since it doesn't compare each entry.

  • inherited
    operator [](K key) ISet<V>?
    Return the set for the given key. If the key doesn't exist, return null.
    inherited