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.collection.dev; | 5 part of dart._collection.dev; |
6 | 6 |
7 typedef T _Transformation<S, T>(S value); | 7 typedef T _Transformation<S, T>(S value); |
8 | 8 |
9 class MappedIterable<S, T> extends Iterable<T> { | 9 class MappedIterable<S, T> extends Iterable<T> { |
10 final Iterable<S> _iterable; | 10 final Iterable<S> _iterable; |
11 // TODO(ahe): Restore type when feature is implemented in dart2js | 11 // TODO(ahe): Restore type when feature is implemented in dart2js |
12 // checked mode. http://dartbug.com/7733 | 12 // checked mode. http://dartbug.com/7733 |
13 final /* _Transformation<S, T> */ _f; | 13 final /* _Transformation<S, T> */ _f; |
14 | 14 |
15 MappedIterable(this._iterable, T this._f(S element)); | 15 MappedIterable(this._iterable, T this._f(S element)); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 _hasSkipped = true; | 217 _hasSkipped = true; |
218 while (_iterator.moveNext()) { | 218 while (_iterator.moveNext()) { |
219 if (!_f(_iterator.current)) return true; | 219 if (!_f(_iterator.current)) return true; |
220 } | 220 } |
221 } | 221 } |
222 return _iterator.moveNext(); | 222 return _iterator.moveNext(); |
223 } | 223 } |
224 | 224 |
225 E get current => _iterator.current; | 225 E get current => _iterator.current; |
226 } | 226 } |
OLD | NEW |