| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |