Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: sdk/lib/collection/linked_hash_map.dart

Issue 23494027: Make LinkedHashMap also have a factory constructor and be customizable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/collection/linked_hash_map.dart
diff --git a/sdk/lib/collection/linked_hash_map.dart b/sdk/lib/collection/linked_hash_map.dart
index ff6f045fa10404f0234fa17437bee3a69d5b2afe..970e48dd95ebe2591e155ffb4ac9414483723100 100644
--- a/sdk/lib/collection/linked_hash_map.dart
+++ b/sdk/lib/collection/linked_hash_map.dart
@@ -18,8 +18,9 @@ part of dart.collection;
*
* The map allows `null` as a key.
*/
-class LinkedHashMap<K, V> implements HashMap<K, V> {
- external LinkedHashMap();
+abstract class LinkedHashMap<K, V> implements HashMap<K, V> {
+ external factory LinkedHashMap({ bool equals(K key1, K key2),
floitsch 2013/09/05 13:44:28 If we require key1 and key2 to be of type K we mig
Lasse Reichstein Nielsen 2013/09/06 08:49:24 I thought about this and decided that this was the
+ int hashCode(K key) });
/**
* Creates a [LinkedHashMap] that contains all key value pairs of [other].
@@ -64,35 +65,4 @@ class LinkedHashMap<K, V> implements HashMap<K, V> {
Maps._fillMapWithIterables(map, keys, values);
return map;
}
-
- external bool containsKey(Object key);
-
- external bool containsValue(Object value);
-
- external void addAll(Map<K, V> other);
-
- external V operator [](Object key);
-
- external void operator []=(K key, V value);
-
- external V putIfAbsent(K key, V ifAbsent());
-
- external V remove(Object key);
-
- external void clear();
-
- external void forEach(void action (K key, V value));
-
- /** The keys of the map, in insertion order. */
- external Iterable<K> get keys;
- /** The values of the map, in the order of their corresponding [keys].*/
- external Iterable<V> get values;
-
- external int get length;
-
- external bool get isEmpty;
-
- external bool get isNotEmpty;
-
- String toString() => Maps.mapToString(this);
}

Powered by Google App Engine
This is Rietveld 408576698