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 |
11 * for certain operations. Different collections are optimized for different | 11 * for certain operations. Different collections are optimized for different |
12 * uses. | 12 * uses. |
13 * | 13 * |
14 * A collection can be updated by adding or removing elements. | 14 * A collection can be updated by adding or removing elements. |
15 * | 15 * |
16 * Collections are [Iterable]. The order of iteration is defined by | 16 * Collections are [Iterable]. The order of iteration is defined by |
17 * each type of collection. | 17 * each type of collection. |
18 * | 18 * |
19 * *Deprecated*: This class is deprecated and will be removed soon. | 19 * *Deprecated*: This class is deprecated and will be removed soon. |
20 */ | 20 */ |
21 abstract class Collection<E> extends Iterable<E> { | 21 abstract class Collection<E> extends IterableBase<E> { |
22 const Collection(); | 22 const Collection(); |
23 | 23 |
24 /** | 24 /** |
25 * Adds an element to this collection. | 25 * Adds an element to this collection. |
26 */ | 26 */ |
27 void add(E element); | 27 void add(E element); |
28 | 28 |
29 /** | 29 /** |
30 * Adds all of [elements] to this collection. | 30 * Adds all of [elements] to this collection. |
31 * | 31 * |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 IterableMixinWorkaround.retainWhere(this, test); | 87 IterableMixinWorkaround.retainWhere(this, test); |
88 } | 88 } |
89 | 89 |
90 /** | 90 /** |
91 * Removes all elements of this collection. | 91 * Removes all elements of this collection. |
92 */ | 92 */ |
93 void clear() { | 93 void clear() { |
94 IterableMixinWorkaround.removeWhere(this, (E e) => true); | 94 IterableMixinWorkaround.removeWhere(this, (E e) => true); |
95 } | 95 } |
96 } | 96 } |
OLD | NEW |