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

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

Issue 12646005: Add Set.union, Set.difference. Change Set methods to expect Set. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
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 * 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 17 matching lines...) Expand all
28 void add(E value); 28 void add(E value);
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 [collection] contains all the elements of this 38 * Returns true if [other] contains all the elements of this Set.
39 * collection.
40 */ 39 */
41 bool isSubsetOf(Collection<E> collection); 40 bool isSubsetOf(Set<E> other);
42 41
43 /** 42 /**
44 * Returns true if this collection contains all the elements of 43 * Returns true if this Set contains all the elements of
floitsch 2013/03/12 16:25:00 Fits on one line.
Lasse Reichstein Nielsen 2013/03/13 13:01:42 Done.
45 * [collection]. 44 * [other].
46 */ 45 */
47 bool containsAll(Collection<E> collection); 46 bool containsAll(Set<E> other);
48 47
49 /** 48 /**
50 * Returns a new set which is the intersection between this set and 49 * Returns a new set which is the intersection between this set and
floitsch 2013/03/12 16:25:00 ditto.
Lasse Reichstein Nielsen 2013/03/13 13:01:42 Done.
Lasse Reichstein Nielsen 2013/03/13 13:01:42 Done.
51 * the given collection. 50 * [other].
52 */ 51 */
53 Set<E> intersection(Collection<E> other); 52 Set<E> intersection(Set<E> other);
53
54 /**
55 * Returns a new set which contains all the elements of this set and [other].
56 */
57 Set<E> union(Set<E> other);
58
59 /**
60 * Returns a new set with the the elements of this that are not in [other].
61 */
62 Set<E> difference(Set<E> other);
54 63
55 /** 64 /**
56 * Removes all elements in the set. 65 * Removes all elements in the set.
57 */ 66 */
58 void clear(); 67 void clear();
59 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698