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 * The [Iterable] interface allows to get an [Iterator] out of an | 8 * The [Iterable] interface allows to get an [Iterator] out of an |
9 * [Iterable] object. | 9 * [Iterable] object. |
10 * | 10 * |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 _index++; | 425 _index++; |
426 return true; | 426 return true; |
427 } else { | 427 } else { |
428 _current = null; | 428 _current = null; |
429 return false; | 429 return false; |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 E get current => _current; | 433 E get current => _current; |
434 } | 434 } |
| 435 |
| 436 /** |
| 437 * An [Iterator] that allows moving backwards as well as forwards. |
| 438 */ |
| 439 abstract class BiDirectionalIterator<T> extends Iterator<T> { |
| 440 /** |
| 441 * Move back to the previous element. |
| 442 * |
| 443 * Returns true and updates [current] if successful. Returns false |
| 444 * and sets [current] to null if there is no previous element. |
| 445 */ |
| 446 bool movePrevious(); |
| 447 } |
OLD | NEW |