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 13 matching lines...) Expand all Loading... | |
| 24 * | 24 * |
| 25 * You can implement Iterable in your own class. | 25 * You can implement Iterable in your own class. |
| 26 * If you do, then an instance of your Iterable class | 26 * If you do, then an instance of your Iterable class |
| 27 * can be the right-hand side of a for-in construct. | 27 * can be the right-hand side of a for-in construct. |
| 28 * | 28 * |
| 29 * Some subclasss of [Iterable] can be modified. It is generally not allowed | 29 * Some subclasss of [Iterable] can be modified. It is generally not allowed |
| 30 * to modify such collections while they are being iterated. Doing so will break | 30 * to modify such collections while they are being iterated. Doing so will break |
| 31 * the iteration, which is typically signalled by throwing a | 31 * the iteration, which is typically signalled by throwing a |
| 32 * [ConcurrentModificationError] when it is detected. | 32 * [ConcurrentModificationError] when it is detected. |
| 33 */ | 33 */ |
| 34 @SupportJsExtensionMethods() | |
|
Jacob
2015/04/02 20:07:03
Similarly we should add the annotation that implem
| |
| 34 abstract class Iterable<E> { | 35 abstract class Iterable<E> { |
| 35 const Iterable(); | 36 const Iterable(); |
| 36 | 37 |
| 37 /** | 38 /** |
| 38 * Creates an Iterable that generates its elements dynamically. | 39 * Creates an Iterable that generates its elements dynamically. |
| 39 * | 40 * |
| 40 * The Iterators created by the Iterable count from | 41 * The Iterators created by the Iterable count from |
| 41 * zero to [:count - 1:] while iterating, and call [generator] | 42 * zero to [:count - 1:] while iterating, and call [generator] |
| 42 * with that index to create the next value. | 43 * with that index to create the next value. |
| 43 * | 44 * |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 */ | 371 */ |
| 371 abstract class BidirectionalIterator<E> implements Iterator<E> { | 372 abstract class BidirectionalIterator<E> implements Iterator<E> { |
| 372 /** | 373 /** |
| 373 * Move back to the previous element. | 374 * Move back to the previous element. |
| 374 * | 375 * |
| 375 * Returns true and updates [current] if successful. Returns false | 376 * Returns true and updates [current] if successful. Returns false |
| 376 * and sets [current] to null if there is no previous element. | 377 * and sets [current] to null if there is no previous element. |
| 377 */ | 378 */ |
| 378 bool movePrevious(); | 379 bool movePrevious(); |
| 379 } | 380 } |
| OLD | NEW |