| 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 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A collection of individual elements. | 8 * A collection of individual elements. |
| 9 * | 9 * |
| 10 * A [Collection] contains some elements in a structure optimized | 10 * A [Collection] contains some elements in a structure optimized |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Removes all elements of this collection that fail to satisfy [test]. | 80 * Removes all elements of this collection that fail to satisfy [test]. |
| 81 * | 81 * |
| 82 * An elements [:e:] satisfies [test] if [:test(e):] is true. | 82 * An elements [:e:] satisfies [test] if [:test(e):] is true. |
| 83 */ | 83 */ |
| 84 void retainMatching(bool test(E element)) { | 84 void retainMatching(bool test(E element)) { |
| 85 IterableMixinWorkaround.retainMatching(this, test); | 85 IterableMixinWorkaround.retainMatching(this, test); |
| 86 } | 86 } |
| 87 |
| 88 /** |
| 89 * Removes all elements of this collection. |
| 90 */ |
| 91 void clear() { |
| 92 IterableMixinWorkaround.removeMatching((E e) => true); |
| 93 } |
| 87 } | 94 } |
| OLD | NEW |