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

Side by Side Diff: tools/dom/templates/immutable_list_mixin.darttemplate

Issue 12188011: Added expand method to iterables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « tools/dom/templates/html/impl/impl_Node.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // -- start List<$E> mixins. 1 // -- start List<$E> mixins.
2 // $E is the element type. 2 // $E is the element type.
3 3
4 // From Iterable<$E>: 4 // From Iterable<$E>:
5 5
6 Iterator<$E> get iterator { 6 Iterator<$E> get iterator {
7 // Note: NodeLists are not fixed size. And most probably length shouldn't 7 // Note: NodeLists are not fixed size. And most probably length shouldn't
8 // be cached in both iterator _and_ forEach method. For now caching it 8 // be cached in both iterator _and_ forEach method. For now caching it
9 // for consistency. 9 // for consistency.
10 return new FixedSizeListIterator<$E>(this); 10 return new FixedSizeListIterator<$E>(this);
(...skipping 20 matching lines...) Expand all
31 31
32 Iterable map(f($E element)) => 32 Iterable map(f($E element)) =>
33 IterableMixinWorkaround.mapList(this, f); 33 IterableMixinWorkaround.mapList(this, f);
34 34
35 List mappedBy(f($E element)) => 35 List mappedBy(f($E element)) =>
36 IterableMixinWorkaround.mappedByList(this, f); 36 IterableMixinWorkaround.mappedByList(this, f);
37 37
38 Iterable<$E> where(bool f($E element)) => 38 Iterable<$E> where(bool f($E element)) =>
39 IterableMixinWorkaround.where(this, f); 39 IterableMixinWorkaround.where(this, f);
40 40
41 Iterable expand(Iterable f($E element)) =>
42 IterableMixinWorkaround.expand(this, f);
43
41 bool every(bool f($E element)) => IterableMixinWorkaround.every(this, f); 44 bool every(bool f($E element)) => IterableMixinWorkaround.every(this, f);
42 45
43 bool any(bool f($E element)) => IterableMixinWorkaround.any(this, f); 46 bool any(bool f($E element)) => IterableMixinWorkaround.any(this, f);
44 47
45 List<$E> toList() => new List<$E>.from(this); 48 List<$E> toList() => new List<$E>.from(this);
46 Set<$E> toSet() => new Set<$E>.from(this); 49 Set<$E> toSet() => new Set<$E>.from(this);
47 50
48 bool get isEmpty => this.length == 0; 51 bool get isEmpty => this.length == 0;
49 52
50 Iterable<$E> take(int n) => IterableMixinWorkaround.takeList(this, n); 53 Iterable<$E> take(int n) => IterableMixinWorkaround.takeList(this, n);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 182 }
180 183
181 void insertRange(int start, int rangeLength, [$E initialValue]) { 184 void insertRange(int start, int rangeLength, [$E initialValue]) {
182 throw new UnsupportedError("Cannot insertRange on immutable List."); 185 throw new UnsupportedError("Cannot insertRange on immutable List.");
183 } 186 }
184 187
185 List<$E> getRange(int start, int rangeLength) => 188 List<$E> getRange(int start, int rangeLength) =>
186 Lists.getRange(this, start, rangeLength, <$E>[]); 189 Lists.getRange(this, start, rangeLength, <$E>[]);
187 190
188 // -- end List<$E> mixins. 191 // -- end List<$E> mixins.
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Node.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698