| OLD | NEW |
| 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 * by using its associated key. | 9 * 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 * Maps, and their keys and values, can be iterated. | 13 * Maps, and their keys and values, can be iterated. |
| 14 * The order of iteration is defined by the individual type of map. | 14 * The order of iteration is defined by the individual type of map. |
| 15 * Examples: | 15 * Examples: |
| 16 * | 16 * |
| 17 * * The plain [HashMap] is unordered (no order is guaranteed), | 17 * * The plain [HashMap] is unordered (no order is guaranteed), |
| 18 * * the [LinkedHashMap] iterates in key insertion order, | 18 * * the [LinkedHashMap] iterates in key insertion order, |
| 19 * * and a sorted my like [SplayTreeMap] iterates the keys in sorted order. | 19 * * and a sorted map like [SplayTreeMap] iterates the keys in sorted order. |
| 20 * | 20 * |
| 21 * It is generally not allowed to modify the map (add or remove keys) while | 21 * It is generally not allowed to modify the map (add or remove keys) while |
| 22 * an operation is being performed on the map, for example in functions called | 22 * an operation is being performed on the map, for example in functions called |
| 23 * during a [forEach] or [putIfAbsent] call. | 23 * during a [forEach] or [putIfAbsent] call. |
| 24 * Modifying the map while iterating the keys or values | 24 * Modifying the map while iterating the keys or values |
| 25 * may also break the iteration. | 25 * may also break the iteration. |
| 26 */ | 26 */ |
| 27 abstract class Map<K, V> { | 27 abstract class Map<K, V> { |
| 28 /** | 28 /** |
| 29 * Creates a Map instance with the default implementation, [LinkedHashMap]. | 29 * Creates a Map instance with the default implementation, [LinkedHashMap]. |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 /** | 225 /** |
| 226 * Returns true if there is no key-value pair in the map. | 226 * Returns true if there is no key-value pair in the map. |
| 227 */ | 227 */ |
| 228 bool get isEmpty; | 228 bool get isEmpty; |
| 229 | 229 |
| 230 /** | 230 /** |
| 231 * Returns true if there is at least one key-value pair in the map. | 231 * Returns true if there is at least one key-value pair in the map. |
| 232 */ | 232 */ |
| 233 bool get isNotEmpty; | 233 bool get isNotEmpty; |
| 234 } | 234 } |
| OLD | NEW |