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 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated | 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated |
8 // functionality. | 8 // functionality. |
9 class _ChildrenElementList implements List { | 9 class _ChildrenElementList implements List { |
10 // Raw Element. | 10 // Raw Element. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 String join([String separator]) { | 60 String join([String separator]) { |
61 return IterableMixinWorkaround.joinList(this, separator); | 61 return IterableMixinWorkaround.joinList(this, separator); |
62 } | 62 } |
63 | 63 |
64 Iterable map(f(Element element)) { | 64 Iterable map(f(Element element)) { |
65 return IterableMixinWorkaround.mapList(this, f); | 65 return IterableMixinWorkaround.mapList(this, f); |
66 } | 66 } |
67 | 67 |
| 68 List mappedBy(f(Element element)) { |
| 69 return IterableMixinWorkaround.mappedByList(this, f); |
| 70 } |
| 71 |
68 Iterable<Element> where(bool f(Element element)) { | 72 Iterable<Element> where(bool f(Element element)) { |
69 return IterableMixinWorkaround.where(this, f); | 73 return IterableMixinWorkaround.where(this, f); |
70 } | 74 } |
71 | 75 |
72 Iterable expand(Iterable f(Element element)) { | 76 Iterable expand(Iterable f(Element element)) { |
73 return IterableMixinWorkaround.expand(this, f); | 77 return IterableMixinWorkaround.expand(this, f); |
74 } | 78 } |
75 | 79 |
76 bool get isEmpty { | 80 bool get isEmpty { |
77 return _element.$dom_firstElementChild == null; | 81 return _element.$dom_firstElementChild == null; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void addAll(Iterable<Element> iterable) { | 142 void addAll(Iterable<Element> iterable) { |
139 if (iterable is _ChildNodeListLazy) { | 143 if (iterable is _ChildNodeListLazy) { |
140 iterable = new List.from(iterable); | 144 iterable = new List.from(iterable); |
141 } | 145 } |
142 | 146 |
143 for (Element element in iterable) { | 147 for (Element element in iterable) { |
144 _element.$dom_appendChild(element); | 148 _element.$dom_appendChild(element); |
145 } | 149 } |
146 } | 150 } |
147 | 151 |
148 Iterable<Element> get reversed { | 152 List<Element> get reversed { |
149 return IterableMixinWorkaround.reversedList(this); | 153 return IterableMixinWorkaround.reversedList(this); |
150 } | 154 } |
151 | 155 |
152 void sort([int compare(Element a, Element b)]) { | 156 void sort([int compare(Element a, Element b)]) { |
153 throw new UnsupportedError('TODO(jacobr): should we impl?'); | 157 throw new UnsupportedError('TODO(jacobr): should we impl?'); |
154 } | 158 } |
155 | 159 |
156 dynamic reduce(dynamic initialValue, | 160 dynamic reduce(dynamic initialValue, |
157 dynamic combine(dynamic previousValue, Element element)) { | 161 dynamic combine(dynamic previousValue, Element element)) { |
158 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 162 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } | 283 } |
280 | 284 |
281 String join([String separator]) { | 285 String join([String separator]) { |
282 return IterableMixinWorkaround.joinList(this, separator); | 286 return IterableMixinWorkaround.joinList(this, separator); |
283 } | 287 } |
284 | 288 |
285 Iterable map(f(Element element)) { | 289 Iterable map(f(Element element)) { |
286 return IterableMixinWorkaround.mapList(this, f); | 290 return IterableMixinWorkaround.mapList(this, f); |
287 } | 291 } |
288 | 292 |
| 293 List mappedBy(f(Element element)) { |
| 294 return IterableMixinWorkaround.mappedByList(this, f); |
| 295 } |
| 296 |
289 Iterable<Element> where(bool f(Element element)) { | 297 Iterable<Element> where(bool f(Element element)) { |
290 return IterableMixinWorkaround.where(this, f); | 298 return IterableMixinWorkaround.where(this, f); |
291 } | 299 } |
292 | 300 |
293 Iterable expand(Iterable f(Element element)) { | 301 Iterable expand(Iterable f(Element element)) { |
294 return IterableMixinWorkaround.expand(this, f); | 302 return IterableMixinWorkaround.expand(this, f); |
295 } | 303 } |
296 | 304 |
297 bool every(bool f(Element element)) { | 305 bool every(bool f(Element element)) { |
298 for(Element element in this) { | 306 for(Element element in this) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 void addLast(Element value) { | 376 void addLast(Element value) { |
369 throw new UnsupportedError(''); | 377 throw new UnsupportedError(''); |
370 } | 378 } |
371 | 379 |
372 Iterator<Element> get iterator => new _FrozenElementListIterator(this); | 380 Iterator<Element> get iterator => new _FrozenElementListIterator(this); |
373 | 381 |
374 void addAll(Iterable<Element> iterable) { | 382 void addAll(Iterable<Element> iterable) { |
375 throw new UnsupportedError(''); | 383 throw new UnsupportedError(''); |
376 } | 384 } |
377 | 385 |
378 Iterable<Element> get reversed { | 386 List<Element> get reversed { |
379 return IterableMixinWorkaround.reversedList(this); | 387 return IterableMixinWorkaround.reversedList(this); |
380 } | 388 } |
381 | 389 |
382 void sort([int compare(Element a, Element b)]) { | 390 void sort([int compare(Element a, Element b)]) { |
383 throw new UnsupportedError(''); | 391 throw new UnsupportedError(''); |
384 } | 392 } |
385 | 393 |
386 dynamic reduce(dynamic initialValue, | 394 dynamic reduce(dynamic initialValue, |
387 dynamic combine(dynamic previousValue, Element element)) { | 395 dynamic combine(dynamic previousValue, Element element)) { |
388 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 396 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 const ScrollAlignment._internal(this._value); | 1116 const ScrollAlignment._internal(this._value); |
1109 toString() => 'ScrollAlignment.$_value'; | 1117 toString() => 'ScrollAlignment.$_value'; |
1110 | 1118 |
1111 /// Attempt to align the element to the top of the scrollable area. | 1119 /// Attempt to align the element to the top of the scrollable area. |
1112 static const TOP = const ScrollAlignment._internal('TOP'); | 1120 static const TOP = const ScrollAlignment._internal('TOP'); |
1113 /// Attempt to center the element in the scrollable area. | 1121 /// Attempt to center the element in the scrollable area. |
1114 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1122 static const CENTER = const ScrollAlignment._internal('CENTER'); |
1115 /// Attempt to align the element to the bottom of the scrollable area. | 1123 /// Attempt to align the element to the bottom of the scrollable area. |
1116 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1124 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
1117 } | 1125 } |
OLD | NEW |