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

Side by Side Diff: client/html/src/DocumentFragmentWrappingImplementation.dart

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | « client/html/src/CssClassSet.dart ('k') | client/html/src/ElementWrappingImplementation.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class FilteredElementList implements ElementList { 5 class FilteredElementList implements ElementList {
6 final Node _node; 6 final Node _node;
7 final NodeList _childNodes; 7 final NodeList _childNodes;
8 8
9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; 9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node;
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 Element removeLast() { 85 Element removeLast() {
86 var last = this.last(); 86 var last = this.last();
87 if (last != null) { 87 if (last != null) {
88 last.remove(); 88 last.remove();
89 } 89 }
90 return last; 90 return last;
91 } 91 }
92 92
93 Collection map(f(Element element)) => _filtered.map(f);
93 Collection<Element> filter(bool f(Element element)) => _filtered.filter(f); 94 Collection<Element> filter(bool f(Element element)) => _filtered.filter(f);
94 bool every(bool f(Element element)) => _filtered.every(f); 95 bool every(bool f(Element element)) => _filtered.every(f);
95 bool some(bool f(Element element)) => _filtered.some(f); 96 bool some(bool f(Element element)) => _filtered.some(f);
96 bool isEmpty() => _filtered.isEmpty(); 97 bool isEmpty() => _filtered.isEmpty();
97 int get length() => _filtered.length; 98 int get length() => _filtered.length;
98 Element operator [](int index) => _filtered[index]; 99 Element operator [](int index) => _filtered[index];
99 Iterator<Element> iterator() => _filtered.iterator(); 100 Iterator<Element> iterator() => _filtered.iterator();
100 List<Element> getRange(int start, int length) => 101 List<Element> getRange(int start, int length) =>
101 _filtered.getRange(start, length); 102 _filtered.getRange(start, length);
102 int indexOf(Element element, [int start = 0]) => 103 int indexOf(Element element, [int start = 0]) =>
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 "Title can't be set for document fragments."); 365 "Title can't be set for document fragments.");
365 } 366 }
366 367
367 void set webkitdropzone(String value) { 368 void set webkitdropzone(String value) {
368 throw new UnsupportedOperationException( 369 throw new UnsupportedOperationException(
369 "WebKit drop zone can't be set for document fragments."); 370 "WebKit drop zone can't be set for document fragments.");
370 } 371 }
371 372
372 DocumentFragment clone(bool deep) => super.clone(deep); 373 DocumentFragment clone(bool deep) => super.clone(deep);
373 } 374 }
OLDNEW
« no previous file with comments | « client/html/src/CssClassSet.dart ('k') | client/html/src/ElementWrappingImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698