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

Unified Diff: packages/quiver/lib/src/collection/delegates/iterable.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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: packages/quiver/lib/src/collection/delegates/iterable.dart
diff --git a/packages/quiver/lib/src/collection/delegates/iterable.dart b/packages/quiver/lib/src/collection/delegates/iterable.dart
index 14f5ed1c5f9b861b4e1977e8fbd35b49fd9fe944..8784920c13ff8e3c1bcfae954070baf029ab6d4d 100644
--- a/packages/quiver/lib/src/collection/delegates/iterable.dart
+++ b/packages/quiver/lib/src/collection/delegates/iterable.dart
@@ -14,19 +14,16 @@
part of quiver.collection;
-/**
- * An implementation of [Iterable] that delegates all methods to another
- * [Iterable].
- * For instance you can create a FruitIterable like this :
- *
- * class FruitIterable extends DelegatingIterable<Fruit> {
- * final Iterable<Fruit> _fruits = [];
- *
- * Iterable<Fruit> get delegate => _fruits;
- *
- * // custom methods
- * }
- */
+/// An implementation of [Iterable] that delegates all methods to another
+/// [Iterable]. For instance you can create a FruitIterable like this :
+///
+/// class FruitIterable extends DelegatingIterable<Fruit> {
+/// final Iterable<Fruit> _fruits = [];
+///
+/// Iterable<Fruit> get delegate => _fruits;
+///
+/// // custom methods
+/// }
abstract class DelegatingIterable<E> implements Iterable<E> {
Iterable<E> get delegate;
@@ -38,15 +35,15 @@ abstract class DelegatingIterable<E> implements Iterable<E> {
bool every(bool test(E element)) => delegate.every(test);
- Iterable expand(Iterable f(E element)) => delegate.expand(f);
+ Iterable<T> expand<T>(Iterable<T> f(E element)) => delegate.expand(f);
E get first => delegate.first;
E firstWhere(bool test(E element), {E orElse()}) =>
delegate.firstWhere(test, orElse: orElse);
- fold(initialValue, combine(previousValue, E element)) =>
- delegate.fold(initialValue, combine);
+ T fold<T>(T initialValue, T combine(T previousValue, E element)) => delegate
+ .fold(initialValue, combine);
void forEach(void f(E element)) => delegate.forEach(f);
@@ -65,7 +62,7 @@ abstract class DelegatingIterable<E> implements Iterable<E> {
int get length => delegate.length;
- Iterable map(f(E element)) => delegate.map(f);
+ Iterable<T> map<T>(T f(E e)) => delegate.map(f);
E reduce(E combine(E value, E element)) => delegate.reduce(combine);
« no previous file with comments | « packages/quiver/lib/src/collection/bimap.dart ('k') | packages/quiver/lib/src/collection/delegates/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698