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

Side by Side Diff: tools/dom/src/CssClassSet.dart

Issue 14173003: Remove Collection, Collections and clean up List/Set/Queue implementations of retain/remove. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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/src/AttributeMap.dart ('k') | tools/dom/src/WrappedList.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 part of html; 5 part of html;
6 6
7 abstract class CssClassSet implements Set<String> { 7 abstract class CssClassSet implements Set<String> {
8 8
9 String toString() { 9 String toString() {
10 return readClasses().join(' '); 10 return readClasses().join(' ');
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 void removeWhere(bool test(String name)) { 143 void removeWhere(bool test(String name)) {
144 _modify((s) => s.removeWhere(test)); 144 _modify((s) => s.removeWhere(test));
145 } 145 }
146 146
147 void retainWhere(bool test(String name)) { 147 void retainWhere(bool test(String name)) {
148 _modify((s) => s.retainWhere(test)); 148 _modify((s) => s.retainWhere(test));
149 } 149 }
150 150
151 bool isSubsetOf(Collection<String> collection) =>
152 readClasses().isSubsetOf(collection);
153
154 bool containsAll(Iterable<String> collection) => 151 bool containsAll(Iterable<String> collection) =>
155 readClasses().containsAll(collection); 152 readClasses().containsAll(collection);
156 153
157 Set<String> intersection(Set<String> other) => 154 Set<String> intersection(Set<String> other) =>
158 readClasses().intersection(other); 155 readClasses().intersection(other);
159 156
160 Set<String> union(Set<String> other) => 157 Set<String> union(Set<String> other) =>
161 readClasses().union(other); 158 readClasses().union(other);
162 159
163 Set<String> difference(Set<String> other) => 160 Set<String> difference(Set<String> other) =>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 */ 207 */
211 Set<String> readClasses(); 208 Set<String> readClasses();
212 209
213 /** 210 /**
214 * Join all the elements of a set into one string and write 211 * Join all the elements of a set into one string and write
215 * back to the element. 212 * back to the element.
216 * This is intended to be overridden by specific implementations. 213 * This is intended to be overridden by specific implementations.
217 */ 214 */
218 void writeClasses(Set<String> s); 215 void writeClasses(Set<String> s);
219 } 216 }
OLDNEW
« no previous file with comments | « tools/dom/src/AttributeMap.dart ('k') | tools/dom/src/WrappedList.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698