addEntries method

  1. @override
void addEntries(
  1. Iterable<MapEntry<String, Iterable<V>>> entries
)
inherited

Adds all associations contained in entries to this TTMultiMap.

Is equivilent to calling addValues for each entry.

keyMapping is applied to all incoming keys so keys may be altered or skipped during copying from entries.

Depending on characteristics of values collection type operation may or may not change this instance. For example if this instance holds values in a Set then it may not be updated if value already exists.

Implementation

@override
void addEntries(Iterable<MapEntry<String, Iterable<V>>> entries) {
  ArgumentError.checkNotNull(entries, 'entries');
  var newKey = false;
  entries.forEach((final entry) {
    final key = _mapKey(entry.key);
    if (key.isNotEmpty) {
      newKey |= _addIterable(key.runes.toList(), entry.value);
    }
  });

  if (newKey) {
    _version.value.incKeysVersion();
  }

  // Lot of work to determine if value change has occured so just assume it has
  _version.value.incValuesVersion();
}