| OLD | NEW |
| 1 part of dart.collection; | 1 part of dart.collection; |
| 2 abstract class MapBase<K, V> = Object with MapMixin<K, V>; | 2 abstract class MapBase<K, V> = Object with MapMixin<K, V>; |
| 3 abstract class MapMixin<K, V> implements Map<K, V> {Iterable<K> get keys; | 3 abstract class MapMixin<K, V> implements Map<K, V> {Iterable<K> get keys; |
| 4 V operator [](Object key); | 4 V operator [](Object key); |
| 5 operator []=(K key, V value); | 5 operator []=(K key, V value); |
| 6 V remove(Object key); | 6 V remove(Object key); |
| 7 void clear(); | 7 void clear(); |
| 8 void forEach(void action(K key, V value)) { | 8 void forEach(void action(K key, V value)) { |
| 9 for (K key in keys) { | 9 for (K key in keys) { |
| 10 action(key, this[key]); | 10 action(key, this[key]); |
| 11 } | 11 } |
| 12 } | 12 } |
| 13 void addAll(Map<K, V> other) { | 13 void addAll(Map<K, V> other) { |
| 14 for (K key in other.keys) { | 14 for (K key in other.keys) { |
| 15 this[key] = other[key]; | 15 this[key] = other[key]; |
| 16 } | 16 } |
| 17 } | 17 } |
| 18 bool containsValue(V value) { | 18 bool containsValue(Object value) { |
| 19 for (K key in keys) { | 19 for (K key in keys) { |
| 20 if (this[key] == value) return true; | 20 if (this[key] == value) return true; |
| 21 } | 21 } |
| 22 return false; | 22 return false; |
| 23 } | 23 } |
| 24 V putIfAbsent(K key, V ifAbsent()) { | 24 V putIfAbsent(K key, V ifAbsent()) { |
| 25 if (keys.contains(key)) { | 25 if (keys.contains(key)) { |
| 26 return this[key]; | 26 return this[key]; |
| 27 } | 27 } |
| 28 return this[key] = ifAbsent(); | 28 return this[key] = ifAbsent(); |
| 29 } | 29 } |
| 30 bool containsKey(Object key) => keys.contains(key); | 30 bool containsKey(Object key) => keys.contains(key); |
| 31 int get length => keys.length; | 31 int get length => keys.length; |
| 32 bool get isEmpty => keys.isEmpty; | 32 bool get isEmpty => keys.isEmpty; |
| 33 bool get isNotEmpty => keys.isNotEmpty; | 33 bool get isNotEmpty => keys.isNotEmpty; |
| 34 Iterable<V> get values => new _MapBaseValueIterable<V>(this); | 34 Iterable<V> get values => new _MapBaseValueIterable<V>(this); |
| 35 String toString() => Maps.mapToString(this); | 35 String toString() => Maps.mapToString(this); |
| 36 } | 36 } |
| 37 abstract class UnmodifiableMapBase<K, V> = MapBase<K, V> with _UnmodifiableMapM
ixin<K, V>; | 37 abstract class UnmodifiableMapBase<K, V> = MapBase<K, V> with _UnmodifiableMapM
ixin<K, V>; |
| 38 class _MapBaseValueIterable<V> extends IterableBase<V> implements EfficientLeng
th {final Map _map; | 38 class _MapBaseValueIterable<V> extends IterableBase<V> implements EfficientLeng
th {final Map _map; |
| 39 _MapBaseValueIterable(this._map); | 39 _MapBaseValueIterable(this._map); |
| 40 int get length => _map.length; | 40 int get length => _map.length; |
| 41 bool get isEmpty => _map.isEmpty; | 41 bool get isEmpty => _map.isEmpty; |
| 42 bool get isNotEmpty => _map.isNotEmpty; | 42 bool get isNotEmpty => _map.isNotEmpty; |
| 43 V get first => ((__x7) => DEVC$RT.cast(__x7, dynamic, V, "CompositeCast", """li
ne 122, column 18 of dart:collection/maps.dart: """, __x7 is V, false))(_map[_ma
p.keys.first]); | 43 V get first => ((__x11) => DEVC$RT.cast(__x11, dynamic, V, "CompositeCast", """
line 122, column 18 of dart:collection/maps.dart: """, __x11 is V, false))(_map[
_map.keys.first]); |
| 44 V get single => ((__x8) => DEVC$RT.cast(__x8, dynamic, V, "CompositeCast", """l
ine 123, column 19 of dart:collection/maps.dart: """, __x8 is V, false))(_map[_m
ap.keys.single]); | 44 V get single => ((__x12) => DEVC$RT.cast(__x12, dynamic, V, "CompositeCast", ""
"line 123, column 19 of dart:collection/maps.dart: """, __x12 is V, false))(_map
[_map.keys.single]); |
| 45 V get last => ((__x9) => DEVC$RT.cast(__x9, dynamic, V, "CompositeCast", """lin
e 124, column 17 of dart:collection/maps.dart: """, __x9 is V, false))(_map[_map
.keys.last]); | 45 V get last => ((__x13) => DEVC$RT.cast(__x13, dynamic, V, "CompositeCast", """l
ine 124, column 17 of dart:collection/maps.dart: """, __x13 is V, false))(_map[_
map.keys.last]); |
| 46 Iterator<V> get iterator => new _MapBaseValueIterator<V>(_map); | 46 Iterator<V> get iterator => new _MapBaseValueIterator<V>(_map); |
| 47 } | 47 } |
| 48 class _MapBaseValueIterator<V> implements Iterator<V> {final Iterator _keys; | 48 class _MapBaseValueIterator<V> implements Iterator<V> {final Iterator _keys; |
| 49 final Map _map; | 49 final Map _map; |
| 50 V _current = null; | 50 V _current = null; |
| 51 _MapBaseValueIterator(Map map) : _map = map, _keys = map.keys.iterator; | 51 _MapBaseValueIterator(Map map) : _map = map, _keys = map.keys.iterator; |
| 52 bool moveNext() { | 52 bool moveNext() { |
| 53 if (_keys.moveNext()) { | 53 if (_keys.moveNext()) { |
| 54 _current = ((__x10) => DEVC$RT.cast(__x10, dynamic, V, "CompositeCast", """line
144, column 18 of dart:collection/maps.dart: """, __x10 is V, false))(_map[_keys
.current]); | 54 _current = ((__x14) => DEVC$RT.cast(__x14, dynamic, V, "CompositeCast", """line
144, column 18 of dart:collection/maps.dart: """, __x14 is V, false))(_map[_keys
.current]); |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 _current = null; | 57 _current = null; |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 V get current => _current; | 60 V get current => _current; |
| 61 } | 61 } |
| 62 abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {void operator
[]=(K key, V value) { | 62 abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {void operator
[]=(K key, V value) { |
| 63 throw new UnsupportedError("Cannot modify unmodifiable map"); | 63 throw new UnsupportedError("Cannot modify unmodifiable map"); |
| 64 } | 64 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 while (hasNextKey && hasNextValue) { | 184 while (hasNextKey && hasNextValue) { |
| 185 map[keyIterator.current] = valueIterator.current; | 185 map[keyIterator.current] = valueIterator.current; |
| 186 hasNextKey = keyIterator.moveNext(); | 186 hasNextKey = keyIterator.moveNext(); |
| 187 hasNextValue = valueIterator.moveNext(); | 187 hasNextValue = valueIterator.moveNext(); |
| 188 } | 188 } |
| 189 if (hasNextKey || hasNextValue) { | 189 if (hasNextKey || hasNextValue) { |
| 190 throw new ArgumentError("Iterables do not have same length."); | 190 throw new ArgumentError("Iterables do not have same length."); |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 } | 193 } |
| OLD | NEW |