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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/core/set.dart
diff --git a/sdk/lib/core/set.dart b/sdk/lib/core/set.dart
index 7977986f268daacd668dc68900453dc640f1c079..1d221a55b8d3a5f8ec986a25382da3ca2082d0cb 100644
--- a/sdk/lib/core/set.dart
+++ b/sdk/lib/core/set.dart
@@ -35,22 +35,31 @@ abstract class Set<E> extends Collection<E> {
bool remove(Object value);
/**
- * Returns true if [collection] contains all the elements of this
- * collection.
+ * Returns true if [other] contains all the elements of this Set.
*/
- bool isSubsetOf(Collection<E> collection);
+ bool isSubsetOf(Set<E> other);
/**
- * Returns true if this collection contains all the elements of
- * [collection].
+ * 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.
+ * [other].
*/
- bool containsAll(Collection<E> collection);
+ bool containsAll(Set<E> other);
/**
* 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.
- * the given collection.
+ * [other].
*/
- Set<E> intersection(Collection<E> other);
+ Set<E> intersection(Set<E> other);
+
+ /**
+ * Returns a new set which contains all the elements of this set and [other].
+ */
+ Set<E> union(Set<E> other);
+
+ /**
+ * Returns a new set with the the elements of this that are not in [other].
+ */
+ Set<E> difference(Set<E> other);
/**
* Removes all elements in the set.

Powered by Google App Engine
This is Rietveld 408576698