| 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 * using its associated key. | 9 * using its associated key. |
| 10 * | 10 * |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 * List<String> letters = ['b', 'c']; | 128 * List<String> letters = ['b', 'c']; |
| 129 * List<String> words = ['bad', 'cat']; | 129 * List<String> words = ['bad', 'cat']; |
| 130 * Map<String, String> map = new Map.fromIterables(letters, words); | 130 * Map<String, String> map = new Map.fromIterables(letters, words); |
| 131 * map['b'] + map['c']; // badcat | 131 * map['b'] + map['c']; // badcat |
| 132 * | 132 * |
| 133 * If [keys] contains the same object multiple times, the last occurrence | 133 * If [keys] contains the same object multiple times, the last occurrence |
| 134 * overwrites the previous value. | 134 * overwrites the previous value. |
| 135 * | 135 * |
| 136 * The two [Iterable]s must have the same length. | 136 * The two [Iterable]s must have the same length. |
| 137 */ | 137 */ |
| 138 factory Map.fromIterables(Iterable<K> keys, Iterable<V> values) | 138 factory Map.fromIterables(Iterable<K> keys, Iterable<V> values) = |
| 139 = LinkedHashMap<K, V>.fromIterables; | 139 LinkedHashMap<K, V>.fromIterables; |
| 140 | 140 |
| 141 /** | 141 /** |
| 142 * Returns true if this map contains the given [value]. | 142 * Returns true if this map contains the given [value]. |
| 143 * | 143 * |
| 144 * Returns true if any of the values in the map are equal to `value` | 144 * Returns true if any of the values in the map are equal to `value` |
| 145 * according to the `==` operator. | 145 * according to the `==` operator. |
| 146 */ | 146 */ |
| 147 bool containsValue(Object value); | 147 bool containsValue(Object value); |
| 148 | 148 |
| 149 /** | 149 /** |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 /** | 267 /** |
| 268 * Returns true if there is no key-value pair in the map. | 268 * Returns true if there is no key-value pair in the map. |
| 269 */ | 269 */ |
| 270 bool get isEmpty; | 270 bool get isEmpty; |
| 271 | 271 |
| 272 /** | 272 /** |
| 273 * Returns true if there is at least one key-value pair in the map. | 273 * Returns true if there is at least one key-value pair in the map. |
| 274 */ | 274 */ |
| 275 bool get isNotEmpty; | 275 bool get isNotEmpty; |
| 276 } | 276 } |
| OLD | NEW |