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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 _index++; | 406 _index++; |
407 return true; | 407 return true; |
408 } else { | 408 } else { |
409 _current = null; | 409 _current = null; |
410 return false; | 410 return false; |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 E get current => _current; | 414 E get current => _current; |
415 } | 415 } |
| 416 |
| 417 /** |
| 418 * An [Iterator] that allows moving backwards as well as forwards. |
| 419 */ |
| 420 abstract class BiDirectionalIterator<T> extends Iterator<T> { |
| 421 /** |
| 422 * Move back to the previous element. |
| 423 * |
| 424 * Returns true and updates [current] if successful. Returns false |
| 425 * and sets [current] to null if there is no previous element. |
| 426 */ |
| 427 bool movePrevious(); |
| 428 } |
OLD | NEW |