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

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

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. 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
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 bool containsAll(Collection<String> collection) => 108 bool containsAll(Collection<String> collection) =>
109 readClasses().containsAll(collection); 109 readClasses().containsAll(collection);
110 110
111 Set<String> intersection(Collection<String> other) => 111 Set<String> intersection(Collection<String> other) =>
112 readClasses().intersection(other); 112 readClasses().intersection(other);
113 113
114 String get first => readClasses().first; 114 String get first => readClasses().first;
115 String get last => readClasses().last; 115 String get last => readClasses().last;
116 String get single => readClasses().single; 116 String get single => readClasses().single;
117 List<String> toList() => readClasses().toList(); 117 List<String> toList({ bool growable: false }) =>
118 readClasses().toList(growable: growable);
118 Set<String> toSet() => readClasses().toSet(); 119 Set<String> toSet() => readClasses().toSet();
119 String min([int compare(String a, String b)]) => 120 String min([int compare(String a, String b)]) =>
120 readClasses().min(compare); 121 readClasses().min(compare);
121 String max([int compare(String a, String b)]) => 122 String max([int compare(String a, String b)]) =>
122 readClasses().max(compare); 123 readClasses().max(compare);
123 Iterable<String> take(int n) => readClasses().take(n); 124 Iterable<String> take(int n) => readClasses().take(n);
124 Iterable<String> takeWhile(bool test(String value)) => 125 Iterable<String> takeWhile(bool test(String value)) =>
125 readClasses().takeWhile(test); 126 readClasses().takeWhile(test);
126 Iterable<String> skip(int n) => readClasses().skip(n); 127 Iterable<String> skip(int n) => readClasses().skip(n);
127 Iterable<String> skipWhile(bool test(String value)) => 128 Iterable<String> skipWhile(bool test(String value)) =>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 */ 162 */
162 Set<String> readClasses(); 163 Set<String> readClasses();
163 164
164 /** 165 /**
165 * Join all the elements of a set into one string and write 166 * Join all the elements of a set into one string and write
166 * back to the element. 167 * back to the element.
167 * This is intended to be overridden by specific implementations. 168 * This is intended to be overridden by specific implementations.
168 */ 169 */
169 void writeClasses(Set<String> s); 170 void writeClasses(Set<String> s);
170 } 171 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698