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

Side by Side Diff: sdk/lib/core/map.dart

Issue 24267023: Update implementations to use Object.identityHashCode for identity map/set (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Add tests. Fix few bugs now that it can run. Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/collection/linked_hash_set.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * An unordered collection of key-value pairs, 8 * An unordered collection of key-value pairs,
9 * from which you retrieve a value by using its associated key. 9 * from which you retrieve a value by using its associated key.
10 * 10 *
11 * Each key can occur at most once in a map. 11 * Each key can occur at most once in a map.
12 */ 12 */
13 abstract class Map<K, V> { 13 abstract class Map<K, V> {
14 /** 14 /**
15 * Creates a Map instance with the default implementation. 15 * Creates a Map instance with the default implementation.
16 */ 16 */
17 factory Map() = LinkedHashMap<K, V>; 17 factory Map() = LinkedHashMap<K, V>;
18 18
19 /** 19 /**
20 * Creates a Map instance that contains all key-value pairs of [other]. 20 * Creates a Map instance that contains all key-value pairs of [other].
21 */ 21 */
22 factory Map.from(Map<K, V> other) = LinkedHashMap<K, V>.from; 22 factory Map.from(Map<K, V> other) = LinkedHashMap<K, V>.from;
23 23
24 /** 24 /**
25 * Creates an identity map with the default implementation.
26 */
27 factory Map.identity() = LinkedHashMap<K, V>.identity;
28
29 /**
25 * Creates a Map instance 30 * Creates a Map instance
26 * where the keys and values are computed from the [iterable]. 31 * where the keys and values are computed from the [iterable].
27 * 32 *
28 * For each element of the [iterable] this constructor computes a key-value 33 * For each element of the [iterable] this constructor computes a key-value
29 * pair, by applying [key] and [value] respectively. 34 * pair, by applying [key] and [value] respectively.
30 * 35 *
31 * The keys computed by the source [iterable] 36 * The keys computed by the source [iterable]
32 * do not need to be unique. The last 37 * do not need to be unique. The last
33 * occurrence of a key will simply overwrite any previous value. 38 * occurrence of a key will simply overwrite any previous value.
34 * 39 *
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 /** 139 /**
135 * Returns true if there is no {key, value} pair in the map. 140 * Returns true if there is no {key, value} pair in the map.
136 */ 141 */
137 bool get isEmpty; 142 bool get isEmpty;
138 143
139 /** 144 /**
140 * Returns true if there is at least one {key, value} pair in the map. 145 * Returns true if there is at least one {key, value} pair in the map.
141 */ 146 */
142 bool get isNotEmpty; 147 bool get isNotEmpty;
143 } 148 }
OLDNEW
« no previous file with comments | « sdk/lib/collection/linked_hash_set.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698