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

Unified Diff: sdk/lib/core/list.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
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 12b8aedfb5baa03647163e15411c0d14f47aaa2b..0180558228cc7b8130734e1260ea996c8289a37c 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -34,7 +34,7 @@ part of dart.core;
* unmodifiableList.add(499); // throws
* unmodifiableList[0] = 87; // throws.
*/
-abstract class List<E> implements Collection<E> {
+abstract class List<E> implements Iterable<E> {
/**
* Creates a list of the given [length].
*
@@ -50,18 +50,6 @@ abstract class List<E> implements Collection<E> {
external factory List.filled(int length, E fill);
/**
- * *Deprecated*: Use `new List(count)` instead.
- */
- @deprecated
- factory List.fixedLength(int count, { E fill }) {
- List<E> result = new List(count);
- if (fill != null) {
- for (int i = 0; i < count; i++) result[i] = fill;
- }
- return result;
- }
-
- /**
* Creates an list with the elements of [other]. The order in
* the list will be the order provided by the iterator of [other].
*
@@ -201,6 +189,13 @@ abstract class List<E> implements Collection<E> {
void insert(int index, E element);
/**
+ * Removes [value] from the list. Returns true if [value] was
+ * in the list. Returns false otherwise. The method has no effect
+ * if [value] value was not in the list.
+ */
+ bool remove(Object value);
+
+ /**
* Removes the element at position [index] from the list.
*
* This reduces the length of the list by one and moves all later elements
@@ -222,6 +217,20 @@ abstract class List<E> implements Collection<E> {
E removeLast();
/**
+ * Removes all elements of this list that satisfy [test].
+ *
+ * An elements [:e:] satisfies [test] if [:test(e):] is true.
+ */
+ void removeWhere(bool test(E element));
+
+ /**
+ * Removes all elements of this list that fail to satisfy [test].
+ *
+ * An elements [:e:] satisfies [test] if [:test(e):] is true.
+ */
+ void retainWhere(bool test(E element));
+
+ /**
* Returns a new list containing the elemenst from [start] to [end].
*
* If [end] is omitted, the [length] of the list is used.
@@ -232,12 +241,6 @@ abstract class List<E> implements Collection<E> {
List<E> sublist(int start, [int end]);
/**
- * *Deprecated*. Use [sublist] instead.
- */
- @deprecated
- List<E> getRange(int start, int length);
-
- /**
* Copies [length] elements of [from], starting
* at [startFrom], into the list, starting at [start].
* If [length] is 0, this method does not do anything.

Powered by Google App Engine
This is Rietveld 408576698