addValuesToKeys method

IMapOfSets<K, V> addValuesToKeys(
  1. Iterable<K> keys,
  2. Iterable<V> values
)

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.

Implementation

IMapOfSets<K, V> addValuesToKeys(Iterable<K> keys, Iterable<V> values) {
  IMapOfSets<K, V> result = this;
  for (K key in keys) {
    result = result.addValues(key, values);
  }
  return result;
}