OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.dom.html; | 5 part of dart.dom.html; |
6 | 6 |
7 /** | 7 /** |
8 * A list which just wraps another list, for either intercepting list calls or | 8 * A list which just wraps another list, for either intercepting list calls or |
9 * retyping the list (for example, from List<A> to List<B> where B extends A). | 9 * retyping the list (for example, from List<A> to List<B> where B extends A). |
10 */ | 10 */ |
(...skipping 17 matching lines...) Expand all Loading... |
28 void forEach(void f(E element)) { _list.forEach(f); } | 28 void forEach(void f(E element)) { _list.forEach(f); } |
29 | 29 |
30 dynamic reduce(initialValue, combine(previousValue, E element)) => | 30 dynamic reduce(initialValue, combine(previousValue, E element)) => |
31 _list.reduce(initialValue, combine); | 31 _list.reduce(initialValue, combine); |
32 | 32 |
33 dynamic fold(initialValue, combine(previousValue, E element)) => | 33 dynamic fold(initialValue, combine(previousValue, E element)) => |
34 _list.fold(initialValue, combine); | 34 _list.fold(initialValue, combine); |
35 | 35 |
36 bool every(bool f(E element)) => _list.every(f); | 36 bool every(bool f(E element)) => _list.every(f); |
37 | 37 |
38 String join([String separator]) => _list.join(separator); | 38 String join([String separator = ""]) => _list.join(separator); |
39 | 39 |
40 bool any(bool f(E element)) => _list.any(f); | 40 bool any(bool f(E element)) => _list.any(f); |
41 | 41 |
42 List<E> toList({ bool growable: true }) => | 42 List<E> toList({ bool growable: true }) => |
43 new List.from(_list, growable: growable); | 43 new List.from(_list, growable: growable); |
44 | 44 |
45 Set<E> toSet() => _list.toSet(); | 45 Set<E> toSet() => _list.toSet(); |
46 | 46 |
47 int get length => _list.length; | 47 int get length => _list.length; |
48 | 48 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 Iterator _iterator; | 147 Iterator _iterator; |
148 | 148 |
149 _WrappedIterator(this._iterator); | 149 _WrappedIterator(this._iterator); |
150 | 150 |
151 bool moveNext() { | 151 bool moveNext() { |
152 return _iterator.moveNext(); | 152 return _iterator.moveNext(); |
153 } | 153 } |
154 | 154 |
155 E get current => _iterator.current; | 155 E get current => _iterator.current; |
156 } | 156 } |
OLD | NEW |