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

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
« no previous file with comments | « sdk/lib/core/corelib_sources.gypi ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index c0f15698e0e76227942872adc9414469e5679fd1..27a857e9df442afb0bc957bb4f861fe10537009b 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 elements from [start] to [end].
*
* If [end] is omitted, the [length] of the list is used.
« no previous file with comments | « sdk/lib/core/corelib_sources.gypi ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698