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

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

Issue 11366111: Make Iterable more powerful (and lazy). (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Fix current. was in Iterable and not Iterator. Created 8 years, 1 month 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/queryable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/map.dart
diff --git a/sdk/lib/core/map.dart b/sdk/lib/core/map.dart
index 60db6ce71c70ec078f0fd4dcdcd2673803d0c4e4..4c3787903184b0148bf701e8eb0523e82886d092 100644
--- a/sdk/lib/core/map.dart
+++ b/sdk/lib/core/map.dart
@@ -67,14 +67,20 @@ abstract class Map<K, V> {
void forEach(void f(K key, V value));
/**
- * Returns a collection containing all the keys in the map.
+ * Returns a [Queryable] iterating over all the keys in the map.
+ *
+ * The iteration-order is guaranteed to be the same for [keys] and [values].
+ * That is, [values] is equivalent to [:keys.mappedBy((key) => this[key]):];
*/
- Collection<K> get keys;
+ Queryable<K> get keys;
/**
- * Returns a collection containing all the values in the map.
+ * Returns a [Queryable] iterating over all the value of the map.
+ *
+ * The iteration-order is guaranteed to be the same for [keys] and [values].
+ * That is, [values] is equivalent to [:keys.mappedBy((key) => this[key]):];
*/
- Collection<V> get values;
+ Queryable<V> get values;
/**
* The number of {key, value} pairs in the map.
@@ -85,6 +91,13 @@ abstract class Map<K, V> {
* Returns true if there is no {key, value} pair in the map.
*/
bool get isEmpty;
+
+ /**
+ * Returns a read-only view of [this].
+ *
+ * The returned [Map] is backed by [this] but cannot change [this].
+ */
+ Map<K, V> get view;
}
/**
« no previous file with comments | « sdk/lib/core/list.dart ('k') | sdk/lib/core/queryable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698