SplayTreeMap<K, V>.fromIterables constructor

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

Creates a SplayTreeMap associating the given keys to values.

This constructor iterates over keys and values and maps each element of keys to the corresponding element of values.

If keys contains the same object multiple times, the last occurrence overwrites the previous value.

It is an error if the two Iterables don't have the same length.

Implementation

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);
  MapBase._fillMapWithIterables(map, keys, values);
  return map;
}