OLD | NEW |
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 // TODO - figure out whether classList exists, and if so use that | 5 // TODO - figure out whether classList exists, and if so use that |
6 // rather than the className property that is being used here. | 6 // rather than the className property that is being used here. |
7 | 7 |
8 class _CssClassSet implements Set<String> { | 8 class _CssClassSet implements Set<String> { |
9 | 9 |
10 final _element; | 10 final _element; |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 bool some(bool f(String element)) { | 41 bool some(bool f(String element)) { |
42 return _read().some(f); | 42 return _read().some(f); |
43 } | 43 } |
44 | 44 |
45 bool isEmpty() { | 45 bool isEmpty() { |
46 return _read().isEmpty(); | 46 return _read().isEmpty(); |
47 } | 47 } |
48 | 48 |
49 int get length() { | 49 int get length { |
50 return _read().length; | 50 return _read().length; |
51 } | 51 } |
52 // interface Collection - END | 52 // interface Collection - END |
53 | 53 |
54 // interface Set - BEGIN | 54 // interface Set - BEGIN |
55 bool contains(String value) { | 55 bool contains(String value) { |
56 return _read().contains(value); | 56 return _read().contains(value); |
57 } | 57 } |
58 | 58 |
59 void add(String value) { | 59 void add(String value) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 String _formatSet(Set<String> s) { | 143 String _formatSet(Set<String> s) { |
144 // TODO(mattsh) should be able to pass Set to String.joins http:/b/5398605 | 144 // TODO(mattsh) should be able to pass Set to String.joins http:/b/5398605 |
145 List list = new List.from(s); | 145 List list = new List.from(s); |
146 return Strings.join(list, ' '); | 146 return Strings.join(list, ' '); |
147 } | 147 } |
148 | 148 |
149 } | 149 } |
150 | 150 |
OLD | NEW |