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

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 24740003: Add List.shuffle(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adddress comments Created 7 years, 2 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
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 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 class _ChildrenElementList extends ListBase<Element> { 7 class _ChildrenElementList extends ListBase<Element> {
8 // Raw Element. 8 // Raw Element.
9 final Element _element; 9 final Element _element;
10 final HtmlCollection _childElements; 10 final HtmlCollection _childElements;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 for (Element element in iterable) { 52 for (Element element in iterable) {
53 _element.append(element); 53 _element.append(element);
54 } 54 }
55 } 55 }
56 56
57 void sort([int compare(Element a, Element b)]) { 57 void sort([int compare(Element a, Element b)]) {
58 throw new UnsupportedError('Cannot sort element lists'); 58 throw new UnsupportedError('Cannot sort element lists');
59 } 59 }
60 60
61 void shuffle() {
62 throw new UnsupportedError('Cannot shuffle element lists');
63 }
64
61 void removeWhere(bool test(Element element)) { 65 void removeWhere(bool test(Element element)) {
62 _filter(test, false); 66 _filter(test, false);
63 } 67 }
64 68
65 void retainWhere(bool test(Element element)) { 69 void retainWhere(bool test(Element element)) {
66 _filter(test, true); 70 _filter(test, true);
67 } 71 }
68 72
69 void _filter(bool test(var element), bool retainMatching) { 73 void _filter(bool test(var element), bool retainMatching) {
70 var removed; 74 var removed;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 273 }
270 274
271 void set length(int newLength) { 275 void set length(int newLength) {
272 throw new UnsupportedError('Cannot modify list'); 276 throw new UnsupportedError('Cannot modify list');
273 } 277 }
274 278
275 void sort([Comparator<Element> compare]) { 279 void sort([Comparator<Element> compare]) {
276 throw new UnsupportedError('Cannot sort list'); 280 throw new UnsupportedError('Cannot sort list');
277 } 281 }
278 282
283 void shuffle() {
284 throw new UnsupportedError('Cannot shuffle list');
285 }
286
279 Element get first => _nodeList.first; 287 Element get first => _nodeList.first;
280 288
281 Element get last => _nodeList.last; 289 Element get last => _nodeList.last;
282 290
283 Element get single => _nodeList.single; 291 Element get single => _nodeList.single;
284 292
285 CssClassSet get classes => new _MultiElementCssClassSet(_elementList); 293 CssClassSet get classes => new _MultiElementCssClassSet(_elementList);
286 294
287 CssStyleDeclarationBase get style => 295 CssStyleDeclarationBase get style =>
288 new _CssStyleDeclarationSet(_elementList); 296 new _CssStyleDeclarationSet(_elementList);
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 const ScrollAlignment._internal(this._value); 1375 const ScrollAlignment._internal(this._value);
1368 toString() => 'ScrollAlignment.$_value'; 1376 toString() => 'ScrollAlignment.$_value';
1369 1377
1370 /// Attempt to align the element to the top of the scrollable area. 1378 /// Attempt to align the element to the top of the scrollable area.
1371 static const TOP = const ScrollAlignment._internal('TOP'); 1379 static const TOP = const ScrollAlignment._internal('TOP');
1372 /// Attempt to center the element in the scrollable area. 1380 /// Attempt to center the element in the scrollable area.
1373 static const CENTER = const ScrollAlignment._internal('CENTER'); 1381 static const CENTER = const ScrollAlignment._internal('CENTER');
1374 /// Attempt to align the element to the bottom of the scrollable area. 1382 /// Attempt to align the element to the bottom of the scrollable area.
1375 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1383 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1376 } 1384 }
OLDNEW
« no previous file with comments | « tools/dom/src/ImmutableListMixin.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698