| 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 | 5 |
| 6 // TODO(srdjan): Use shared array implementation. | 6 // TODO(srdjan): Use shared array implementation. |
| 7 class _ObjectArray<E> implements List<E> { | 7 class _ObjectArray<E> implements List<E> { |
| 8 | 8 |
| 9 factory _ObjectArray(int length) native "ObjectArray_allocate"; | 9 factory _ObjectArray(int length) native "ObjectArray_allocate"; |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 reduce(initialValue, combine(previousValue, E element)) { | 111 reduce(initialValue, combine(previousValue, E element)) { |
| 112 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 112 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| 113 } | 113 } |
| 114 | 114 |
| 115 Iterable<E> where(bool f(E element)) { | 115 Iterable<E> where(bool f(E element)) { |
| 116 return IterableMixinWorkaround.where(this, f); | 116 return IterableMixinWorkaround.where(this, f); |
| 117 } | 117 } |
| 118 | 118 |
| 119 Iterable expand(Iterable f(E element)) { |
| 120 return IterableMixinWorkaround.expand(this, f); |
| 121 } |
| 122 |
| 119 Iterable<E> take(int n) { | 123 Iterable<E> take(int n) { |
| 120 return IterableMixinWorkaround.takeList(this, n); | 124 return IterableMixinWorkaround.takeList(this, n); |
| 121 } | 125 } |
| 122 | 126 |
| 123 Iterable<E> takeWhile(bool test(E value)) { | 127 Iterable<E> takeWhile(bool test(E value)) { |
| 124 return IterableMixinWorkaround.takeWhile(this, test); | 128 return IterableMixinWorkaround.takeWhile(this, test); |
| 125 } | 129 } |
| 126 | 130 |
| 127 Iterable<E> skip(int n) { | 131 Iterable<E> skip(int n) { |
| 128 return IterableMixinWorkaround.skipList(this, n); | 132 return IterableMixinWorkaround.skipList(this, n); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 347 } |
| 344 | 348 |
| 345 reduce(initialValue, combine(previousValue, E element)) { | 349 reduce(initialValue, combine(previousValue, E element)) { |
| 346 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 350 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| 347 } | 351 } |
| 348 | 352 |
| 349 Iterable<E> where(bool f(E element)) { | 353 Iterable<E> where(bool f(E element)) { |
| 350 return IterableMixinWorkaround.where(this, f); | 354 return IterableMixinWorkaround.where(this, f); |
| 351 } | 355 } |
| 352 | 356 |
| 357 Iterable expand(Iterable f(E element)) { |
| 358 return IterableMixinWorkaround.expand(this, f); |
| 359 } |
| 360 |
| 353 Iterable<E> take(int n) { | 361 Iterable<E> take(int n) { |
| 354 return IterableMixinWorkaround.takeList(this, n); | 362 return IterableMixinWorkaround.takeList(this, n); |
| 355 } | 363 } |
| 356 | 364 |
| 357 Iterable<E> takeWhile(bool test(E value)) { | 365 Iterable<E> takeWhile(bool test(E value)) { |
| 358 return IterableMixinWorkaround.takeWhile(this, test); | 366 return IterableMixinWorkaround.takeWhile(this, test); |
| 359 } | 367 } |
| 360 | 368 |
| 361 Iterable<E> skip(int n) { | 369 Iterable<E> skip(int n) { |
| 362 return IterableMixinWorkaround.skipList(this, n); | 370 return IterableMixinWorkaround.skipList(this, n); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 } | 506 } |
| 499 _position = _length; | 507 _position = _length; |
| 500 _current = null; | 508 _current = null; |
| 501 return false; | 509 return false; |
| 502 } | 510 } |
| 503 | 511 |
| 504 E get current { | 512 E get current { |
| 505 return _current; | 513 return _current; |
| 506 } | 514 } |
| 507 } | 515 } |
| OLD | NEW |