| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.collection; | 5 part of dart.collection; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A hash-table based implementation of [Map]. | 8 * A hash-table based implementation of [Map]. |
| 9 * | 9 * |
| 10 * The insertion order of keys is remembered, | 10 * The insertion order of keys is remembered, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 * The used `equals` and `hashCode` method should always be consistent, | 65 * The used `equals` and `hashCode` method should always be consistent, |
| 66 * so that if `equals(a, b)` then `hashCode(a) == hashCode(b)`. The hash | 66 * so that if `equals(a, b)` then `hashCode(a) == hashCode(b)`. The hash |
| 67 * of an object, or what it compares equal to, should not change while the | 67 * of an object, or what it compares equal to, should not change while the |
| 68 * object is in the table. If it does change, the result is unpredictable. | 68 * object is in the table. If it does change, the result is unpredictable. |
| 69 * | 69 * |
| 70 * If you supply one of [equals] and [hashCode], | 70 * If you supply one of [equals] and [hashCode], |
| 71 * you should generally also to supply the other. | 71 * you should generally also to supply the other. |
| 72 */ | 72 */ |
| 73 external factory LinkedHashMap({bool equals(K key1, K key2), | 73 external factory LinkedHashMap({bool equals(K key1, K key2), |
| 74 int hashCode(K key), | 74 int hashCode(K key), |
| 75 bool isValidKey(potentialKey)}); | 75 bool isValidKey(Object potentialKey)}); |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Creates an insertion-ordered identity-based map. | 78 * Creates an insertion-ordered identity-based map. |
| 79 * | 79 * |
| 80 * Effectively a shorthand for: | 80 * Effectively a shorthand for: |
| 81 * | 81 * |
| 82 * new LinkedHashMap(equals: identical, | 82 * new LinkedHashMap(equals: identical, |
| 83 * hashCode: identityHashCode) | 83 * hashCode: identityHashCode) |
| 84 */ | 84 */ |
| 85 external factory LinkedHashMap.identity(); | 85 external factory LinkedHashMap.identity(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 * overwrites the previous value. | 123 * overwrites the previous value. |
| 124 * | 124 * |
| 125 * It is an error if the two [Iterable]s don't have the same length. | 125 * It is an error if the two [Iterable]s don't have the same length. |
| 126 */ | 126 */ |
| 127 factory LinkedHashMap.fromIterables(Iterable<K> keys, Iterable<V> values) { | 127 factory LinkedHashMap.fromIterables(Iterable<K> keys, Iterable<V> values) { |
| 128 LinkedHashMap<K, V> map = new LinkedHashMap<K, V>(); | 128 LinkedHashMap<K, V> map = new LinkedHashMap<K, V>(); |
| 129 Maps._fillMapWithIterables(map, keys, values); | 129 Maps._fillMapWithIterables(map, keys, values); |
| 130 return map; | 130 return map; |
| 131 } | 131 } |
| 132 } | 132 } |
| OLD | NEW |