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 * A collection of objects in which each object can occur only once. | 8 * A collection of objects in which each object can occur only once. |
9 * | 9 * |
10 * That is, for each object of the element type, the object is either considered | 10 * That is, for each object of the element type, the object is either considered |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 * Set<SubType> subSet = | 65 * Set<SubType> subSet = |
66 * new Set<SubType>.from(superSet.where((e) => e is SubType)); | 66 * new Set<SubType>.from(superSet.where((e) => e is SubType)); |
67 * | 67 * |
68 * The created [Set] is a [LinkedHashSet]. As such, it considers elements that | 68 * The created [Set] is a [LinkedHashSet]. As such, it considers elements that |
69 * are equal (using [==]) to be indistinguishable, and requires them to | 69 * are equal (using [==]) to be indistinguishable, and requires them to |
70 * have a compatible [Object.hashCode] implementation. | 70 * have a compatible [Object.hashCode] implementation. |
71 * | 71 * |
72 * The set is equivalent to one created by | 72 * The set is equivalent to one created by |
73 * `new LinkedHashSet<E>.from(elements)`. | 73 * `new LinkedHashSet<E>.from(elements)`. |
74 */ | 74 */ |
75 factory Set.from(Iterable elements) = LinkedHashSet<E>.from; | 75 factory Set.from(Iterable<E> elements) = LinkedHashSet<E>.from; |
76 | 76 |
77 /** | 77 /** |
78 * Provides an iterator that iterates over the elements of this set. | 78 * Provides an iterator that iterates over the elements of this set. |
79 * | 79 * |
80 * The order of iteration is defined by the individual `Set` implementation, | 80 * The order of iteration is defined by the individual `Set` implementation, |
81 * but must be consistent between changes to the set. | 81 * but must be consistent between changes to the set. |
82 */ | 82 */ |
83 Iterator<E> get iterator; | 83 Iterator<E> get iterator; |
84 | 84 |
85 /** | 85 /** |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 /* Creates a [Set] with the same elements and behavior as this `Set`. | 179 /* Creates a [Set] with the same elements and behavior as this `Set`. |
180 * | 180 * |
181 * The returned set behaves the same as this set | 181 * The returned set behaves the same as this set |
182 * with regard to adding and removing elements. | 182 * with regard to adding and removing elements. |
183 * It initially contains the same elements. | 183 * It initially contains the same elements. |
184 * If this set specifies an ordering of the elements, | 184 * If this set specifies an ordering of the elements, |
185 * the returned set will have the same order. | 185 * the returned set will have the same order. |
186 */ | 186 */ |
187 Set<E> toSet(); | 187 Set<E> toSet(); |
188 } | 188 } |
OLD | NEW |