Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: runtime/lib/array.dart

Issue 12094103: Added MappedListIterable/Iterator to implement map() on Lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding missing EmptyIteartor/Iterable Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 void forEach(f(E element)) { 95 void forEach(f(E element)) {
96 IterableMixinWorkaround.forEach(this, f); 96 IterableMixinWorkaround.forEach(this, f);
97 } 97 }
98 98
99 String join([String separator]) { 99 String join([String separator]) {
100 return IterableMixinWorkaround.joinList(this, separator); 100 return IterableMixinWorkaround.joinList(this, separator);
101 } 101 }
102 102
103 Iterable map(f(E element)) { 103 Iterable map(f(E element)) {
104 return IterableMixinWorkaround.map(this, f); 104 return IterableMixinWorkaround.mapList(this, f);
105 } 105 }
106 106
107 List mappedBy(f(E element)) { 107 List mappedBy(f(E element)) {
108 IterableMixinWorkaround.mappedByList(this, f); 108 IterableMixinWorkaround.mappedByList(this, f);
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
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 bool contains(E element) { 325 bool contains(E element) {
326 return IterableMixinWorkaround.contains(this, element); 326 return IterableMixinWorkaround.contains(this, element);
327 } 327 }
328 328
329 void forEach(f(E element)) { 329 void forEach(f(E element)) {
330 IterableMixinWorkaround.forEach(this, f); 330 IterableMixinWorkaround.forEach(this, f);
331 } 331 }
332 332
333 Iterable map(f(E element)) { 333 Iterable map(f(E element)) {
334 return IterableMixinWorkaround.map(this, f); 334 return IterableMixinWorkaround.mapList(this, f);
335 } 335 }
336 336
337 List mappedBy(f(E element)) { 337 List mappedBy(f(E element)) {
338 return IterableMixinWorkaround.mappedByList(this, f); 338 return IterableMixinWorkaround.mappedByList(this, f);
339 } 339 }
340 340
341 String join([String separator]) { 341 String join([String separator]) {
342 return IterableMixinWorkaround.joinList(this, separator); 342 return IterableMixinWorkaround.joinList(this, separator);
343 } 343 }
344 344
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 498 }
499 _position = _length; 499 _position = _length;
500 _current = null; 500 _current = null;
501 return false; 501 return false;
502 } 502 }
503 503
504 E get current { 504 E get current {
505 return _current; 505 return _current;
506 } 506 }
507 } 507 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698