Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: sdk/lib/core/set.dart

Issue 26280002: Set.add returns true if item has been added, otherwise false (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: again Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/lib/collection_patch.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/collection_patch.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698