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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 * | 194 * |
195 * When the iterator encounters an element `e` that does not satisfy [test], | 195 * When the iterator encounters an element `e` that does not satisfy [test], |
196 * it discards `e` and moves into the finished state. That is, it does not | 196 * it discards `e` and moves into the finished state. That is, it does not |
197 * get or provide any more elements. | 197 * get or provide any more elements. |
198 */ | 198 */ |
199 Iterable<E> takeWhile(bool test(E value)); | 199 Iterable<E> takeWhile(bool test(E value)); |
200 | 200 |
201 /** | 201 /** |
202 * Returns an Iterable that skips the first [n] elements. | 202 * Returns an Iterable that skips the first [n] elements. |
203 * | 203 * |
204 * If `this` has fewer than [n] elements, then the resulting Iterable is | 204 * If `this` has fewer than [n] elements, then the resulting Iterable is |
205 * empty. | 205 * empty. |
206 * | 206 * |
207 * It is an error if [n] is negative. | 207 * It is an error if [n] is negative. |
208 */ | 208 */ |
209 Iterable<E> skip(int n); | 209 Iterable<E> skip(int n); |
210 | 210 |
211 /** | 211 /** |
212 * Returns an Iterable that skips elements while [test] is satisfied. | 212 * Returns an Iterable that skips elements while [test] is satisfied. |
213 * | 213 * |
214 * The filtering happens lazily. Every new Iterator of the returned | 214 * The filtering happens lazily. Every new Iterator of the returned |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 */ | 317 */ |
318 abstract class BidirectionalIterator<E> implements Iterator<E> { | 318 abstract class BidirectionalIterator<E> implements Iterator<E> { |
319 /** | 319 /** |
320 * Move back to the previous element. | 320 * Move back to the previous element. |
321 * | 321 * |
322 * Returns true and updates [current] if successful. Returns false | 322 * Returns true and updates [current] if successful. Returns false |
323 * and sets [current] to null if there is no previous element. | 323 * and sets [current] to null if there is no previous element. |
324 */ | 324 */ |
325 bool movePrevious(); | 325 bool movePrevious(); |
326 } | 326 } |
OLD | NEW |