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 * This class is the public interface of a set. A set is a collection | 8 * This class is the public interface of a set. A set is a collection |
9 * without duplicates. | 9 * without duplicates. |
10 */ | 10 */ |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 /** | 30 /** |
31 * Removes [value] from the set. Returns true if [value] was | 31 * Removes [value] from the set. Returns true if [value] was |
32 * in the set. Returns false otherwise. The method has no effect | 32 * in the set. Returns false otherwise. The method has no effect |
33 * if [value] value was not in the set. | 33 * if [value] value was not in the set. |
34 */ | 34 */ |
35 bool remove(Object value); | 35 bool remove(Object value); |
36 | 36 |
37 /** | 37 /** |
38 * Returns true if [other] contains all the elements of this Set. | 38 * Returns true if [other] contains all the elements of this Set. |
| 39 * |
| 40 * *Deprecated*. Use `other.containsAll(thisSet)` instead if [other] |
| 41 * is a Set, and convert `other` to a Set if it isn't. |
39 */ | 42 */ |
40 bool isSubsetOf(Set<E> other); | 43 @deprecated |
| 44 bool isSubsetOf(Iterable<E> other); |
41 | 45 |
42 /** | 46 /** |
43 * Returns true if this Set contains all the elements of [other]. | 47 * Returns true if this Set contains all the elements of [other]. |
44 */ | 48 */ |
45 bool containsAll(Set<E> other); | 49 bool containsAll(Iterable<E> other); |
46 | 50 |
47 /** | 51 /** |
48 * Returns a new set which is the intersection between this set and [other]. | 52 * Returns a new set which is the intersection between this set and [other]. |
49 */ | 53 */ |
50 Set<E> intersection(Set<E> other); | 54 Set<E> intersection(Set<E> other); |
51 | 55 |
52 /** | 56 /** |
53 * Returns a new set which contains all the elements of this set and [other]. | 57 * Returns a new set which contains all the elements of this set and [other]. |
54 */ | 58 */ |
55 Set<E> union(Set<E> other); | 59 Set<E> union(Set<E> other); |
56 | 60 |
57 /** | 61 /** |
58 * Returns a new set with the the elements of this that are not in [other]. | 62 * Returns a new set with the the elements of this that are not in [other]. |
59 */ | 63 */ |
60 Set<E> difference(Set<E> other); | 64 Set<E> difference(Set<E> other); |
61 | 65 |
62 /** | 66 /** |
63 * Removes all elements in the set. | 67 * Removes all elements in the set. |
64 */ | 68 */ |
65 void clear(); | 69 void clear(); |
66 } | 70 } |
OLD | NEW |