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

Unified Diff: sdk/lib/collection_dev/list.dart

Issue 12041045: List.mappedBy/skip/take returns a List. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « no previous file | sdk/lib/core/list.dart » ('j') | sdk/lib/core/list.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection_dev/list.dart
diff --git a/sdk/lib/collection_dev/list.dart b/sdk/lib/collection_dev/list.dart
index cddc75a762baf32e1a11c10c169e6481cf8cb964..b8ecef1dc6f14826f08b7e65115f9c2be2e3478d 100644
--- a/sdk/lib/collection_dev/list.dart
+++ b/sdk/lib/collection_dev/list.dart
@@ -10,7 +10,7 @@ part of dart.collection.dev;
* Implements all read-only operations, except [:operator[]:] and [:length:],
* in terms of those two operations.
*/
-abstract class ListBase<E> extends Iterable<E> implements List<E> {
+abstract class ListBase<E> extends Collection<E> implements List<E> {
Iterator<E> get iterator => new ListIterator(this);
void forEach(f(E element)) {
@@ -93,6 +93,18 @@ abstract class ListBase<E> extends Iterable<E> implements List<E> {
return result;
}
+ List mappedBy(f(E element)) {
+ return new MappedList(this, f);
+ }
+
+ List<E> take(int n) {
+ return new ListView(this, 0, n);
+ }
+
+ List<E> skip(int n) {
+ return new ListView(this, n, null);
+ }
+
String toString() => Collections.collectionToString(this);
}
« no previous file with comments | « no previous file | sdk/lib/core/list.dart » ('j') | sdk/lib/core/list.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698