Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: sdk/lib/core/iterable.dart

Issue 451633003: Make Iterable.toSet say that it returns a Set with the same equality as the Iterable's contains met… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/collection/splay_tree.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * An object that uses an [Iterator] to serve objects one at a time. 8 * An object that uses an [Iterator] to serve objects one at a time.
9 * 9 *
10 * You can iterate over all objects served by an Iterable object 10 * You can iterate over all objects served by an Iterable object
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 * Creates a [List] containing the elements of this [Iterable]. 167 * Creates a [List] containing the elements of this [Iterable].
168 * 168 *
169 * The elements are in iteration order. The list is fixed-length 169 * The elements are in iteration order. The list is fixed-length
170 * if [growable] is false. 170 * if [growable] is false.
171 */ 171 */
172 List<E> toList({ bool growable: true }); 172 List<E> toList({ bool growable: true });
173 173
174 /** 174 /**
175 * Creates a [Set] containing the same elements as this iterable. 175 * Creates a [Set] containing the same elements as this iterable.
176 * 176 *
177 * The returned `Set` will have the same `Set.length` 177 * The set may contain fewer elements than the iterable,
178 * as the `length` of this iterable, 178 * if the iterable contains the an element more than once,
179 * and its `Set.contains` will return the same result 179 * or it contains one or more elements that are equal.
180 * as the `contains` of this iterable. 180 * The order of the elements in the set is not guaranteed to be the same
181 * The order of the elements may be different. 181 * as for the iterable.
182 */ 182 */
183 Set<E> toSet(); 183 Set<E> toSet();
184 184
185 /** 185 /**
186 * Returns the number of elements in [this]. 186 * Returns the number of elements in [this].
187 * 187 *
188 * Counting all elements may be involve running through all elements and can 188 * Counting all elements may be involve running through all elements and can
189 * therefore be slow. 189 * therefore be slow.
190 */ 190 */
191 int get length; 191 int get length;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 */ 367 */
368 abstract class BidirectionalIterator<E> implements Iterator<E> { 368 abstract class BidirectionalIterator<E> implements Iterator<E> {
369 /** 369 /**
370 * Move back to the previous element. 370 * Move back to the previous element.
371 * 371 *
372 * Returns true and updates [current] if successful. Returns false 372 * Returns true and updates [current] if successful. Returns false
373 * and sets [current] to null if there is no previous element. 373 * and sets [current] to null if there is no previous element.
374 */ 374 */
375 bool movePrevious(); 375 bool movePrevious();
376 } 376 }
OLDNEW
« no previous file with comments | « sdk/lib/collection/splay_tree.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698