Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.collection; | 5 part of dart.collection; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A hash-based map that iterates keys and values in key insertion order. | 8 * A hash-based map that iterates keys and values in key insertion order. |
| 9 */ | 9 */ |
| 10 class LinkedHashMap<K, V> implements Map<K, V> { | 10 class LinkedHashMap<K, V> implements Map<K, V> { |
| 11 external LinkedHashMap(); | 11 external LinkedHashMap(); |
| 12 | 12 |
| 13 factory LinkedHashMap.from(Map<K, V> other) { | 13 factory LinkedHashMap.from(Map<K, V> other) { |
| 14 return new LinkedHashMap<K, V>()..addAll(other); | 14 return new LinkedHashMap<K, V>()..addAll(other); |
| 15 } | 15 } |
| 16 | 16 |
| 17 external bool containsKey(K key); | 17 external bool containsKey(Object key); |
| 18 | 18 |
| 19 external bool containsValue(V value); | 19 external bool containsValue(Object value); |
| 20 | 20 |
| 21 external void addAll(Map<K, V> other); | 21 external void addAll(Map<K, V> other); |
| 22 | 22 |
| 23 external V operator [](K key); | 23 external V operator [](Object key); |
| 24 | 24 |
| 25 external void operator []=(K key, V value); | 25 external void operator []=(K key, V value); |
| 26 | 26 |
| 27 external V putIfAbsent(K key, V ifAbsent()); | 27 external V putIfAbsent(K key, V ifAbsent()); |
| 28 | 28 |
| 29 external V remove(K key); | 29 external V remove(K key); |
|
Lasse Reichstein Nielsen
2013/04/30 07:42:27
remove too.
floitsch
2013/06/17 18:25:34
Done.
| |
| 30 | 30 |
| 31 external void clear(); | 31 external void clear(); |
| 32 | 32 |
| 33 external void forEach(void action (K key, V value)); | 33 external void forEach(void action (K key, V value)); |
| 34 | 34 |
| 35 external Iterable<K> get keys; | 35 external Iterable<K> get keys; |
| 36 external Iterable<V> get values; | 36 external Iterable<V> get values; |
| 37 | 37 |
| 38 external int get length; | 38 external int get length; |
| 39 | 39 |
| 40 external bool get isEmpty; | 40 external bool get isEmpty; |
| 41 | 41 |
| 42 String toString() => Maps.mapToString(this); | 42 String toString() => Maps.mapToString(this); |
| 43 } | 43 } |
| OLD | NEW |