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

Side by Side Diff: tool/input_sdk/lib/core/map.dart

Issue 1963723003: update Map (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/patch/core_patch.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 collection of key-value pairs, from which you retrieve a value 8 * An collection of key-value pairs, from which you retrieve a value
9 * using its associated key. 9 * using its associated key.
10 * 10 *
(...skipping 17 matching lines...) Expand all
28 abstract class Map<K, V> { 28 abstract class Map<K, V> {
29 /** 29 /**
30 * Creates a Map instance with the default implementation, [LinkedHashMap]. 30 * Creates a Map instance with the default implementation, [LinkedHashMap].
31 * 31 *
32 * This constructor is equivalent to the non-const map literal `<K,V>{}`. 32 * This constructor is equivalent to the non-const map literal `<K,V>{}`.
33 * 33 *
34 * A `LinkedHashMap` requires the keys to implement compatible 34 * A `LinkedHashMap` requires the keys to implement compatible
35 * `operator==` and `hashCode`, and it allows null as a key. 35 * `operator==` and `hashCode`, and it allows null as a key.
36 * It iterates in key insertion order. 36 * It iterates in key insertion order.
37 */ 37 */
38 factory Map() = LinkedHashMap<K, V>; 38 external factory Map();
39 39
40 /** 40 /**
41 * Creates a [LinkedHashMap] instance that contains all key-value pairs of 41 * Creates a [LinkedHashMap] instance that contains all key-value pairs of
42 * [other]. 42 * [other].
43 * 43 *
44 * The keys must all be assignable to [K] and the values to [V]. 44 * The keys must all be assignable to [K] and the values to [V].
45 * The [other] map itself can have any type. 45 * The [other] map itself can have any type.
46 * 46 *
47 * A `LinkedHashMap` requires the keys to implement compatible 47 * A `LinkedHashMap` requires the keys to implement compatible
48 * `operator==` and `hashCode`, and it allows `null` as a key. 48 * `operator==` and `hashCode`, and it allows `null` as a key.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 * 237 *
238 * The order of iteration is defined by the individual `Map` implementation, 238 * The order of iteration is defined by the individual `Map` implementation,
239 * but must be consistent between changes to the map. 239 * but must be consistent between changes to the map.
240 */ 240 */
241 Iterable<K> get keys; 241 Iterable<K> get keys;
242 242
243 /** 243 /**
244 * The values of [this]. 244 * The values of [this].
245 * 245 *
246 * The values are iterated in the order of their corresponding keys. 246 * The values are iterated in the order of their corresponding keys.
247 * This means that iterating [keys] and [values] in parrallel will 247 * This means that iterating [keys] and [values] in parallel will
248 * provided matching pairs of keys and values. 248 * provided matching pairs of keys and values.
249 * 249 *
250 * The returned iterable has an efficient `length` method based on the 250 * The returned iterable has an efficient `length` method based on the
251 * [length] of the map. Its [Iterable.contains] method is based on 251 * [length] of the map. Its [Iterable.contains] method is based on
252 * `==` comparison. 252 * `==` comparison.
253 */ 253 */
254 Iterable<V> get values; 254 Iterable<V> get values;
255 255
256 /** 256 /**
257 * The number of key-value pairs in the map. 257 * The number of key-value pairs in the map.
258 */ 258 */
259 int get length; 259 int get length;
260 260
261 /** 261 /**
262 * Returns true if there is no key-value pair in the map. 262 * Returns true if there is no key-value pair in the map.
263 */ 263 */
264 bool get isEmpty; 264 bool get isEmpty;
265 265
266 /** 266 /**
267 * Returns true if there is at least one key-value pair in the map. 267 * Returns true if there is at least one key-value pair in the map.
268 */ 268 */
269 bool get isNotEmpty; 269 bool get isNotEmpty;
270 } 270 }
OLDNEW
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/patch/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698