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 objects in which each object can occur only once. | 8 * A collection of objects in which each object can occur only once. |
9 * | 9 * |
10 * That is, for each object of the element type, the object is either considered | 10 * That is, for each object of the element type, the object is either considered |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 * have a compatible [Object.hashCode] implementation. | 52 * have a compatible [Object.hashCode] implementation. |
53 */ | 53 */ |
54 factory Set.from(Iterable<E> other) = LinkedHashSet<E>.from; | 54 factory Set.from(Iterable<E> other) = LinkedHashSet<E>.from; |
55 | 55 |
56 /** | 56 /** |
57 * Returns true if [value] is in the set. | 57 * Returns true if [value] is in the set. |
58 */ | 58 */ |
59 bool contains(Object value); | 59 bool contains(Object value); |
60 | 60 |
61 /** | 61 /** |
62 * Adds [value] into the set. | 62 * Adds [value] into the set. Returns `true` if [value] was added to the set. |
63 * | 63 * |
64 * The method has no effect if [value] is already in the set. | 64 * If [value] already exists, the set is not changed and `false` is returned. |
65 */ | 65 */ |
66 void add(E value); | 66 bool add(E value); |
67 | 67 |
68 /** | 68 /** |
69 * Adds all of [elements] to this Set. | 69 * Adds all of [elements] to this Set. |
70 * | 70 * |
71 * Equivalent to adding each element in [elements] using [add], | 71 * Equivalent to adding each element in [elements] using [add], |
72 * but some collections may be able to optimize it. | 72 * but some collections may be able to optimize it. |
73 */ | 73 */ |
74 void addAll(Iterable<E> elements); | 74 void addAll(Iterable<E> elements); |
75 | 75 |
76 /** | 76 /** |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 * That is, the returned set contains all the elements of this `Set` that | 135 * That is, the returned set contains all the elements of this `Set` that |
136 * are not elements of [other]. | 136 * are not elements of [other]. |
137 */ | 137 */ |
138 Set<E> difference(Set<E> other); | 138 Set<E> difference(Set<E> other); |
139 | 139 |
140 /** | 140 /** |
141 * Removes all elements in the set. | 141 * Removes all elements in the set. |
142 */ | 142 */ |
143 void clear(); | 143 void clear(); |
144 } | 144 } |
OLD | NEW |