Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:collection
  3. SplayTreeMap<K,V>
  4. addAll method
addAll
description

addAll method

voidaddAll(
  1. Map<K,V>other
)
override

Adds all key/value pairs ofother to this map.

If a key ofother is already in this map, its value is overwritten.

The operation is equivalent to doingthis[key] = value for each keyand associated value in other. It iterates overother, which musttherefore not change during the iteration.

final planets = <int, String>{1: 'Mercury', 2: 'Earth'};planets.addAll({5: 'Jupiter', 6: 'Saturn'});print(planets); // {1: Mercury, 2: Earth, 5: Jupiter, 6: Saturn}

Implementation

void addAll(Map<K, V> other) {  other.forEach((K key, V value) {    this[key] = value;  });}
  1. Dart
  2. dart:collection
  3. SplayTreeMap<K,V>
  4. addAll method
SplayTreeMap class

[8]ページ先頭

©2009-2025 Movatter.jp