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 [LinkedHashSet] is a hash-table based [Set] implementation. | 8 * A [LinkedHashSet] is a hash-table based [Set] implementation. |
9 * | 9 * |
10 * The `LinkedHashSet` also keep track of the order that elements were inserted | 10 * The `LinkedHashSet` also keep track of the order that elements were inserted |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 */ | 76 */ |
77 external factory LinkedHashSet({bool equals(E e1, E e2), | 77 external factory LinkedHashSet({bool equals(E e1, E e2), |
78 int hashCode(E e), | 78 int hashCode(E e), |
79 bool isValidKey(potentialKey)}); | 79 bool isValidKey(potentialKey)}); |
80 | 80 |
81 /** | 81 /** |
82 * Creates an insertion-ordered identity-based set. | 82 * Creates an insertion-ordered identity-based set. |
83 * | 83 * |
84 * Effectively a shorthand for: | 84 * Effectively a shorthand for: |
85 * | 85 * |
86 * new LinkedHashSet(equals: identical, | 86 * new LinkedHashSet<E>(equals: identical, |
87 * hashCode: identityHashCode) | 87 * hashCode: identityHashCode) |
88 */ | 88 */ |
89 external factory LinkedHashSet.identity(); | 89 external factory LinkedHashSet.identity(); |
90 | 90 |
91 /** | 91 /** |
92 * Create a linked hash set containing all [elements]. | 92 * Create a linked hash set containing all [elements]. |
93 * | 93 * |
94 * Creates a linked hash set as by `new LinkedHashSet<E>()` and adds each | 94 * Creates a linked hash set as by `new LinkedHashSet<E>()` and adds each |
95 * element of`elements` to this set in the order they are iterated. | 95 * element of`elements` to this set in the order they are iterated. |
96 * | 96 * |
97 * All the [elements] should be assignable to [E]. | 97 * All the [elements] should be assignable to [E]. |
(...skipping 18 matching lines...) Expand all Loading... |
116 * | 116 * |
117 * The elements are iterated in insertion order. | 117 * The elements are iterated in insertion order. |
118 */ | 118 */ |
119 void forEach(void action(E element)); | 119 void forEach(void action(E element)); |
120 | 120 |
121 /** | 121 /** |
122 * Provides an iterator that iterates over the elements in insertion order. | 122 * Provides an iterator that iterates over the elements in insertion order. |
123 */ | 123 */ |
124 Iterator<E> get iterator; | 124 Iterator<E> get iterator; |
125 } | 125 } |
OLD | NEW |