| 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 * A collection of values, or "elements", that can be accessed sequentially. | 8 * A collection of values, or "elements", that can be accessed sequentially. |
| 9 * | 9 * |
| 10 * The elements of the iterable are accessed by getting an [Iterator] | 10 * The elements of the iterable are accessed by getting an [Iterator] |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 * | 167 * |
| 168 * This method returns a view of the mapped elements. As long as the | 168 * This method returns a view of the mapped elements. As long as the |
| 169 * returned [Iterable] is not iterated over, the supplied function [test] will | 169 * returned [Iterable] is not iterated over, the supplied function [test] will |
| 170 * not be invoked. Iterating will not cache results, and thus iterating | 170 * not be invoked. Iterating will not cache results, and thus iterating |
| 171 * multiple times over the returned [Iterable] will invoke the supplied | 171 * multiple times over the returned [Iterable] will invoke the supplied |
| 172 * function [test] multiple times on the same element. | 172 * function [test] multiple times on the same element. |
| 173 */ | 173 */ |
| 174 Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f); | 174 Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f); |
| 175 | 175 |
| 176 /** | 176 /** |
| 177 * Expands each element of this [Iterable]into zero or more elements. | 177 * Expands each element of this [Iterable] into zero or more elements. |
| 178 * | 178 * |
| 179 * The resulting Iterable runs through the elements returned | 179 * The resulting Iterable runs through the elements returned |
| 180 * by [f] for each element of this, in iteration order. | 180 * by [f] for each element of this, in iteration order. |
| 181 * | 181 * |
| 182 * The returned [Iterable] is lazy, and calls [f] for each element | 182 * The returned [Iterable] is lazy, and calls [f] for each element |
| 183 * of this every time it's iterated. | 183 * of this every time it's iterated. |
| 184 */ | 184 */ |
| 185 Iterable expand(Iterable f(E element)) => | 185 Iterable expand(Iterable f(E element)) => |
| 186 new ExpandIterable<E, dynamic>(this, f); | 186 new ExpandIterable<E, dynamic>(this, f); |
| 187 | 187 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 */ | 665 */ |
| 666 abstract class BidirectionalIterator<E> implements Iterator<E> { | 666 abstract class BidirectionalIterator<E> implements Iterator<E> { |
| 667 /** | 667 /** |
| 668 * Move back to the previous element. | 668 * Move back to the previous element. |
| 669 * | 669 * |
| 670 * Returns true and updates [current] if successful. Returns false | 670 * Returns true and updates [current] if successful. Returns false |
| 671 * and sets [current] to null if there is no previous element. | 671 * and sets [current] to null if there is no previous element. |
| 672 */ | 672 */ |
| 673 bool movePrevious(); | 673 bool movePrevious(); |
| 674 } | 674 } |
| OLD | NEW |