| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 * The default equality and hashcode operations are assumed to work on all | 86 * The default equality and hashcode operations are assumed to work on all |
| 87 * objects. | 87 * objects. |
| 88 * | 88 * |
| 89 * Likewise, if `equals` is [identical], `hashCode` is [identityHashCode] | 89 * Likewise, if `equals` is [identical], `hashCode` is [identityHashCode] |
| 90 * and `isValidKey` is omitted, the resulting set is identity based, | 90 * and `isValidKey` is omitted, the resulting set is identity based, |
| 91 * and the `isValidKey` defaults to accepting all keys. | 91 * and the `isValidKey` defaults to accepting all keys. |
| 92 * Such a map can be created directly using [HashSet.identity]. | 92 * Such a map can be created directly using [HashSet.identity]. |
| 93 */ | 93 */ |
| 94 external factory HashSet({bool equals(E e1, E e2), | 94 external factory HashSet({bool equals(E e1, E e2), |
| 95 int hashCode(E e), | 95 int hashCode(E e), |
| 96 bool isValidKey(potentialKey)}); | 96 bool isValidKey(Object potentialKey)}); |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * Creates an unordered identity-based set. | 99 * Creates an unordered identity-based set. |
| 100 * | 100 * |
| 101 * Effectively a shorthand for: | 101 * Effectively a shorthand for: |
| 102 * | 102 * |
| 103 * new HashSet<E>(equals: identical, | 103 * new HashSet<E>(equals: identical, |
| 104 * hashCode: identityHashCode) | 104 * hashCode: identityHashCode) |
| 105 */ | 105 */ |
| 106 external factory HashSet.identity(); | 106 external factory HashSet.identity(); |
| (...skipping 22 matching lines...) Expand all 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 |