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

Side by Side Diff: sdk/lib/html/html_common/css_class_set.dart

Issue 15263004: Adding isNotEmpty property to collection and string. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix template generation Created 7 years, 6 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/io/buffer_list.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_common; 5 part of html_common;
6 6
7 abstract class CssClassSetImpl implements CssClassSet { 7 abstract class CssClassSetImpl implements CssClassSet {
8 8
9 String toString() { 9 String toString() {
10 return readClasses().join(' '); 10 return readClasses().join(' ');
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 Iterable<String> where(bool f(String element)) => readClasses().where(f); 49 Iterable<String> where(bool f(String element)) => readClasses().where(f);
50 50
51 Iterable expand(Iterable f(String element)) => readClasses().expand(f); 51 Iterable expand(Iterable f(String element)) => readClasses().expand(f);
52 52
53 bool every(bool f(String element)) => readClasses().every(f); 53 bool every(bool f(String element)) => readClasses().every(f);
54 54
55 bool any(bool f(String element)) => readClasses().any(f); 55 bool any(bool f(String element)) => readClasses().any(f);
56 56
57 bool get isEmpty => readClasses().isEmpty; 57 bool get isEmpty => readClasses().isEmpty;
58 58
59 bool get isNotEmpty => readClasses().isNotEmpty;
60
59 int get length => readClasses().length; 61 int get length => readClasses().length;
60 62
61 String reduce(String combine(String value, String element)) { 63 String reduce(String combine(String value, String element)) {
62 return readClasses().reduce(combine); 64 return readClasses().reduce(combine);
63 } 65 }
64 66
65 dynamic fold(dynamic initialValue, 67 dynamic fold(dynamic initialValue,
66 dynamic combine(dynamic previousValue, String element)) { 68 dynamic combine(dynamic previousValue, String element)) {
67 return readClasses().fold(initialValue, combine); 69 return readClasses().fold(initialValue, combine);
68 } 70 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 */ 209 */
208 Set<String> readClasses(); 210 Set<String> readClasses();
209 211
210 /** 212 /**
211 * Join all the elements of a set into one string and write 213 * Join all the elements of a set into one string and write
212 * back to the element. 214 * back to the element.
213 * This is intended to be overridden by specific implementations. 215 * This is intended to be overridden by specific implementations.
214 */ 216 */
215 void writeClasses(Set<String> s); 217 void writeClasses(Set<String> s);
216 } 218 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/io/buffer_list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698