OLD | NEW |
| (Empty) |
1 part of dart.collection; | |
2 bool _defaultEquals(Object a, Object b) => a == b; | |
3 int _defaultHashCode(Object a) => a.hashCode; | |
4 typedef bool _Equality<K>(K a, K b); | |
5 typedef int _Hasher<K>(K object); | |
6 abstract class HashMap<K, V> implements Map<K, V> {external factory HashMap({ | |
7 bool equals(K key1, K key2), int hashCode(K key), bool isValidKey(potentialKey
)} | |
8 ); | |
9 external factory HashMap.identity(); | |
10 factory HashMap.from(Map other) { | |
11 HashMap<K, V> result = new HashMap<K, V>(); | |
12 other.forEach((k, v) { | |
13 result[DEVC$RT.cast(k, dynamic, K, "CompositeCast", """line 87, column 35 of
dart:collection/hash_map.dart: """, k is K, false)] = DEVC$RT.cast(v, dynamic,
V, "CompositeCast", """line 87, column 40 of dart:collection/hash_map.dart: """,
v is V, false); | |
14 } | |
15 ); | |
16 return result; | |
17 } | |
18 factory HashMap.fromIterable(Iterable iterable, { | |
19 K key(element), V value(element)} | |
20 ) { | |
21 HashMap<K, V> map = new HashMap<K, V>(); | |
22 Maps._fillMapWithMappedIterable(map, iterable, key, value); | |
23 return map; | |
24 } | |
25 factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) { | |
26 HashMap<K, V> map = new HashMap<K, V>(); | |
27 Maps._fillMapWithIterables(map, keys, values); | |
28 return map; | |
29 } | |
30 } | |
OLD | NEW |