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

Side by Side Diff: corelib/src/map.dart

Issue 8921033: Implement revised factories in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * A [Map] is an associative container, mapping a key to a value. 6 * A [Map] is an associative container, mapping a key to a value.
7 * Null values are supported. 7 * Null values are supported.
8 */ 8 */
9 interface Map<K, V> factory HashMapImplementation/*<K extends Hashable, V>*/ { 9 interface Map<K, V> factory HashMapImplementation/*<K extends Hashable, V>*/ {
10 // See issue 417. Works in the vm, fails in dartc and frog. 10 // See issue 417. Works in the vm, fails in dartc and frog.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 */ 88 */
89 bool isEmpty(); 89 bool isEmpty();
90 } 90 }
91 91
92 /** 92 /**
93 * Hash map version of the [Map] interface. A [HashMap] does not 93 * Hash map version of the [Map] interface. A [HashMap] does not
94 * provide any guarantees on the order of keys and values in [getKeys] 94 * provide any guarantees on the order of keys and values in [getKeys]
95 * and [getValues]. 95 * and [getValues].
96 */ 96 */
97 interface HashMap<K extends Hashable, V> extends Map<K, V> 97 interface HashMap<K extends Hashable, V> extends Map<K, V>
98 factory HashMapImplementation/*<K extends Hashable, V>*/ { 98 factory HashMapImplementation {
99 // See issue 417. Works in the vm, fails in dartc and frog. 99 // See issue 417. Works in the vm, fails in dartc and frog.
100 100
101 /** 101 /**
102 * Creates a map with the default implementation. 102 * Creates a map with the default implementation.
103 */ 103 */
104 HashMap(); 104 HashMap();
105 105
106 /** 106 /**
107 * Creates a [HashMap] that contains all key value pairs of [other]. 107 * Creates a [HashMap] that contains all key value pairs of [other].
108 */ 108 */
109 HashMap.from(Map<K, V> other); 109 HashMap.from(Map<K, V> other);
110 } 110 }
111 111
112 /** 112 /**
113 * Hash map version of the [Map] interface that preserves insertion 113 * Hash map version of the [Map] interface that preserves insertion
114 * order. 114 * order.
115 */ 115 */
116 interface LinkedHashMap<K extends Hashable, V> extends HashMap<K, V> 116 interface LinkedHashMap<K extends Hashable, V> extends HashMap<K, V>
117 factory LinkedHashMapImplementation/*<K extends Hashable, V>*/ { 117 factory LinkedHashMapImplementation {
118 // See issue 417. Works in the vm, fails in dartc and frog. 118 // See issue 417. Works in the vm, fails in dartc and frog.
119 119
120 /** 120 /**
121 * Creates a map with the default implementation. 121 * Creates a map with the default implementation.
122 */ 122 */
123 LinkedHashMap(); 123 LinkedHashMap();
124 124
125 /** 125 /**
126 * Creates a [LinkedHashMap] that contains all key value pairs of [other]. 126 * Creates a [LinkedHashMap] that contains all key value pairs of [other].
127 */ 127 */
128 LinkedHashMap.from(Map<K, V> other); 128 LinkedHashMap.from(Map<K, V> other);
129 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698