OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 class _GrowableObjectArray<T> implements List<T> { | 5 class _GrowableObjectArray<T> implements List<T> { |
6 factory _GrowableObjectArray._uninstantiable() { | 6 factory _GrowableObjectArray._uninstantiable() { |
7 throw new UnsupportedError( | 7 throw new UnsupportedError( |
8 "GrowableObjectArray can only be allocated by the VM"); | 8 "GrowableObjectArray can only be allocated by the VM"); |
9 } | 9 } |
10 | 10 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 | 262 |
263 Iterable map(f(T element)) { | 263 Iterable map(f(T element)) { |
264 return IterableMixinWorkaround.mapList(this, f); | 264 return IterableMixinWorkaround.mapList(this, f); |
265 } | 265 } |
266 | 266 |
267 reduce(initialValue, combine(previousValue, T element)) { | 267 reduce(initialValue, combine(previousValue, T element)) { |
268 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 268 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
269 } | 269 } |
270 | 270 |
| 271 fold(initialValue, combine(previousValue, T element)) { |
| 272 return IterableMixinWorkaround.fold(this, initialValue, combine); |
| 273 } |
| 274 |
271 Iterable<T> where(bool f(T element)) { | 275 Iterable<T> where(bool f(T element)) { |
272 return IterableMixinWorkaround.where(this, f); | 276 return IterableMixinWorkaround.where(this, f); |
273 } | 277 } |
274 | 278 |
275 Iterable expand(Iterable f(T element)) { | 279 Iterable expand(Iterable f(T element)) { |
276 return IterableMixinWorkaround.expand(this, f); | 280 return IterableMixinWorkaround.expand(this, f); |
277 } | 281 } |
278 | 282 |
279 Iterable<T> take(int n) { | 283 Iterable<T> take(int n) { |
280 return IterableMixinWorkaround.takeList(this, n); | 284 return IterableMixinWorkaround.takeList(this, n); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } | 347 } |
344 | 348 |
345 Set<T> toSet() { | 349 Set<T> toSet() { |
346 return new Set<T>.from(this); | 350 return new Set<T>.from(this); |
347 } | 351 } |
348 | 352 |
349 Map<int, T> asMap() { | 353 Map<int, T> asMap() { |
350 return IterableMixinWorkaround.asMapList(this); | 354 return IterableMixinWorkaround.asMapList(this); |
351 } | 355 } |
352 } | 356 } |
OLD | NEW |