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

Unified Diff: sdk/lib/core/set.dart

Issue 14173003: Remove Collection, Collections and clean up List/Set/Queue implementations of retain/remove. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « sdk/lib/core/list.dart ('k') | sdk/lib/core/string.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/set.dart
diff --git a/sdk/lib/core/set.dart b/sdk/lib/core/set.dart
index 8856d41e36d3c568446d22d6021b3d423aea7060..1a8fd151cabed611e39cf48b6327ca95ad521372 100644
--- a/sdk/lib/core/set.dart
+++ b/sdk/lib/core/set.dart
@@ -8,7 +8,7 @@ part of dart.core;
* This class is the public interface of a set. A set is a collection
* without duplicates.
*/
-abstract class Set<E> extends Collection<E> {
+abstract class Set<E> extends Iterable<E> {
factory Set() => new HashSet<E>();
/**
@@ -28,6 +28,14 @@ abstract class Set<E> extends Collection<E> {
void add(E value);
/**
+ * Adds all of [elements] to this Set.
+ *
+ * Equivalent to adding each element in [elements] using [add],
+ * but some collections may be able to optimize it.
+ */
+ void addAll(Iterable<E> elements);
+
+ /**
* Removes [value] from the set. Returns true if [value] was
* in the set. Returns false otherwise. The method has no effect
* if [value] value was not in the set.
@@ -35,13 +43,25 @@ abstract class Set<E> extends Collection<E> {
bool remove(Object value);
/**
- * Returns true if [other] contains all the elements of this Set.
- *
- * *Deprecated*. Use `other.containsAll(thisSet)` instead if [other]
- * is a Set, and convert `other` to a Set if it isn't.
+ * Removes all of [elements] from this set.
+ */
+ void removeAll(Iterable elements);
+
+ /**
+ * Removes all elements of this set that are not
+ * in [elements].
+ */
+ void retainAll(Iterable elements);
+
+ /**
+ * Removes all elements of this set that satisfy [test].
+ */
+ void removeWhere(bool test(E element));
+
+ /**
+ * Removes all elements of this set that fail to satisfy [test].
*/
- @deprecated
- bool isSubsetOf(Iterable<E> other);
+ void retainWhere(bool test(E element));
/**
* Returns true if this Set contains all the elements of [other].
« no previous file with comments | « sdk/lib/core/list.dart ('k') | sdk/lib/core/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698