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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 * therefore be slow. | 155 * therefore be slow. |
156 */ | 156 */ |
157 int get length; | 157 int get length; |
158 | 158 |
159 /** | 159 /** |
160 * Returns true if there is no element in this collection. | 160 * Returns true if there is no element in this collection. |
161 */ | 161 */ |
162 bool get isEmpty; | 162 bool get isEmpty; |
163 | 163 |
164 /** | 164 /** |
| 165 * Returns true if there is at least one element in this collection. |
| 166 */ |
| 167 bool get isNotEmpty; |
| 168 |
| 169 /** |
165 * Returns an [Iterable] with at most [n] elements. | 170 * Returns an [Iterable] with at most [n] elements. |
166 * | 171 * |
167 * The returned [Iterable] may contain fewer than [n] elements, if `this` | 172 * The returned [Iterable] may contain fewer than [n] elements, if `this` |
168 * contains fewer than [n] elements. | 173 * contains fewer than [n] elements. |
169 */ | 174 */ |
170 Iterable<E> take(int n); | 175 Iterable<E> take(int n); |
171 | 176 |
172 /** | 177 /** |
173 * Returns an [Iterable] that stops once [test] is not satisfied anymore. | 178 * Returns an [Iterable] that stops once [test] is not satisfied anymore. |
174 * | 179 * |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 */ | 303 */ |
299 abstract class BidirectionalIterator<E> implements Iterator<E> { | 304 abstract class BidirectionalIterator<E> implements Iterator<E> { |
300 /** | 305 /** |
301 * Move back to the previous element. | 306 * Move back to the previous element. |
302 * | 307 * |
303 * Returns true and updates [current] if successful. Returns false | 308 * Returns true and updates [current] if successful. Returns false |
304 * and sets [current] to null if there is no previous element. | 309 * and sets [current] to null if there is no previous element. |
305 */ | 310 */ |
306 bool movePrevious(); | 311 bool movePrevious(); |
307 } | 312 } |
OLD | NEW |