| 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 /** Common parts of [HashSet] and [LinkedHashSet] implementations. */ | 7 /** Common parts of [HashSet] and [LinkedHashSet] implementations. */ |
| 8 abstract class _HashSetBase<E> extends SetBase<E> { | 8 abstract class _HashSetBase<E> extends SetBase<E> { |
| 9 | 9 |
| 10 // The following two methods override the ones in SetBase. | 10 // The following two methods override the ones in SetBase. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 * | 55 * |
| 56 * The provided [equals] must define a stable equivalence relation, and | 56 * The provided [equals] must define a stable equivalence relation, and |
| 57 * [hashCode] must be consistent with [equals]. If the [equals] or [hashCode] | 57 * [hashCode] must be consistent with [equals]. If the [equals] or [hashCode] |
| 58 * methods won't work on all objects, but only on some instances of E, the | 58 * methods won't work on all objects, but only on some instances of E, the |
| 59 * [isValidKey] predicate can be used to restrict the keys that the functions | 59 * [isValidKey] predicate can be used to restrict the keys that the functions |
| 60 * are applied to. | 60 * are applied to. |
| 61 * Any key for which [isValidKey] returns false is automatically assumed | 61 * Any key for which [isValidKey] returns false is automatically assumed |
| 62 * to not be in the set when asking `contains`. | 62 * to not be in the set when asking `contains`. |
| 63 * | 63 * |
| 64 * If [equals] or [hashCode] are omitted, the set uses | 64 * If [equals] or [hashCode] are omitted, the set uses |
| 65 * the elements' intrinsic [Object.operator==] and [Object.hashCode]. | 65 * the elements' intrinsic [Object.==] and [Object.hashCode]. |
| 66 * | 66 * |
| 67 * If you supply one of [equals] and [hashCode], | 67 * If you supply one of [equals] and [hashCode], |
| 68 * you should generally also to supply the other. | 68 * you should generally also to supply the other. |
| 69 * | 69 * |
| 70 * If the supplied `equals` or `hashCode` functions won't work on all [E] | 70 * If the supplied `equals` or `hashCode` functions won't work on all [E] |
| 71 * objects, and the map will be used in a setting where a non-`E` object | 71 * objects, and the map will be used in a setting where a non-`E` object |
| 72 * is passed to, e.g., `contains`, then the [isValidKey] function should | 72 * is passed to, e.g., `contains`, then the [isValidKey] function should |
| 73 * also be supplied. | 73 * also be supplied. |
| 74 * | 74 * |
| 75 * If [isValidKey] is omitted, it defaults to testing if the object is an | 75 * If [isValidKey] is omitted, it defaults to testing if the object is an |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 /** | 131 /** |
| 132 * Provides an iterator that iterates over the elements of this set. | 132 * Provides an iterator that iterates over the elements of this set. |
| 133 * | 133 * |
| 134 * The order of iteration is unspecified, | 134 * The order of iteration is unspecified, |
| 135 * but consistent between changes to the set. | 135 * but consistent between changes to the set. |
| 136 */ | 136 */ |
| 137 Iterator<E> get iterator; | 137 Iterator<E> get iterator; |
| 138 } | 138 } |
| OLD | NEW |