Chromium Code Reviews| 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 * 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 Loading... | |
| 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 returned `Set` will have a `Set.contains` that return the same result |
|
floitsch
2014/10/02 12:04:17
Remove this sentence. We don't want to give guaran
Lasse Reichstein Nielsen
2014/10/06 10:54:58
Done.
| |
| 178 * as the `length` of this iterable, | |
| 179 * and its `Set.contains` will return the same result | |
| 180 * as the `contains` of this iterable. | 178 * as the `contains` of this iterable. |
| 181 * The order of the elements may be different. | 179 * The set may contain fewer elements than the iterable, |
| 180 * if the iterable contains the same element (or equal elements) more than | |
| 181 * once. | |
| 182 * The order of the elements in the set is not guaranteed to be the same | |
| 183 * as for the iterable. | |
| 182 */ | 184 */ |
| 183 Set<E> toSet(); | 185 Set<E> toSet(); |
| 184 | 186 |
| 185 /** | 187 /** |
| 186 * Returns the number of elements in [this]. | 188 * Returns the number of elements in [this]. |
| 187 * | 189 * |
| 188 * Counting all elements may be involve running through all elements and can | 190 * Counting all elements may be involve running through all elements and can |
| 189 * therefore be slow. | 191 * therefore be slow. |
| 190 */ | 192 */ |
| 191 int get length; | 193 int get length; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 367 */ | 369 */ |
| 368 abstract class BidirectionalIterator<E> implements Iterator<E> { | 370 abstract class BidirectionalIterator<E> implements Iterator<E> { |
| 369 /** | 371 /** |
| 370 * Move back to the previous element. | 372 * Move back to the previous element. |
| 371 * | 373 * |
| 372 * Returns true and updates [current] if successful. Returns false | 374 * Returns true and updates [current] if successful. Returns false |
| 373 * and sets [current] to null if there is no previous element. | 375 * and sets [current] to null if there is no previous element. |
| 374 */ | 376 */ |
| 375 bool movePrevious(); | 377 bool movePrevious(); |
| 376 } | 378 } |
| OLD | NEW |