| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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; | |
| 6 | |
| 7 /** | 5 /** |
| 8 * The [Iterator] class provides methods to iterate over an object. It | 6 * The [Iterator] class provides methods to iterate over an object. It |
| 9 * is transparently used by the for-in construct to test for the end | 7 * is transparently used by the for-in construct to test for the end |
| 10 * of the iteration, and to get the elements. | 8 * of the iteration, and to get the elements. |
| 11 * | 9 * |
| 12 * If the object iterated over is changed during the iteration, the | 10 * If the object iterated over is changed during the iteration, the |
| 13 * behavior is unspecified. | 11 * behavior is unspecified. |
| 14 */ | 12 */ |
| 15 abstract class Iterator<E> { | 13 abstract class Iterator<E> { |
| 16 /** | 14 /** |
| 17 * Gets the next element in the iteration. Throws a | 15 * Gets the next element in the iteration. Throws a |
| 18 * [StateError] if no element is left. | 16 * [StateError] if no element is left. |
| 19 */ | 17 */ |
| 20 E next(); | 18 E next(); |
| 21 | 19 |
| 22 /** | 20 /** |
| 23 * Returns whether the [Iterator] has elements left. | 21 * Returns whether the [Iterator] has elements left. |
| 24 */ | 22 */ |
| 25 bool get hasNext; | 23 bool get hasNext; |
| 26 } | 24 } |
| OLD | NEW |