Spec-Zone.ru › Dart 1

dart:collection

Конструктор фабрики SplayTreeMap.fromIterables

SplayTreeMap.fromIterables(Iterable<K> keys, Iterable<V> values, [ int compare(K key1, K key2), bool isValidKey(potentialKey) ])

Создаёт SplayTreeMap, сопоставляя заданные keys с values.

Этот конструктор перебирает keys и values и сопоставляет каждый элемент keys с соответствующим элементом values.

Если keys содержит один и тот же объект несколько раз, то последнее значение перезаписывает предыдущее.

Ошибка возникает, если два Iterable имеют разную длину.

Исходный код

factory SplayTreeMap.fromIterables(Iterable<K> keys, Iterable<V> values,
    [int compare(K key1, K key2), bool isValidKey(potentialKey)]) {
  SplayTreeMap<K, V> map = new SplayTreeMap<K, V>(compare, isValidKey);
  Maps._fillMapWithIterables(map, keys, values);
  return map;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-collection/SplayTreeMap/SplayTreeMap.fromIterables.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API