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

Unified Diff: sdk/lib/collection/linked_hash_map.dart

Issue 16285004: Better documentation on Sets and Maps, and more. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 6 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/collection/hash_set.dart ('k') | sdk/lib/collection/linked_hash_set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/linked_hash_map.dart
diff --git a/sdk/lib/collection/linked_hash_map.dart b/sdk/lib/collection/linked_hash_map.dart
index d41cb408b2e45d94b5bcf4ce5ff00561a9bf5ad9..8e6538c995a1d873eab56db286a02056529dd09b 100644
--- a/sdk/lib/collection/linked_hash_map.dart
+++ b/sdk/lib/collection/linked_hash_map.dart
@@ -5,7 +5,18 @@
part of dart.collection;
/**
- * A hash-based map that iterates keys and values in key insertion order.
+ * A hash-table based implementation of [Map].
+ *
+ * Keys insertion order is remembered, and keys are iterated in insertion order.
+ * Values are iterated in their corresponding key's order.
+ *
+ * The keys of a `HashMap` must have consistent [Object.operator==]
+ * and [Object.hashCode] implementations. This means that the `==` operator
+ * must define a stable equivalence relation on the keys (reflexive,
+ * anti-symmetric, transitive, and consistent over time), and that `hashCode`
+ * must be the same for objects that are considered equal by `==`.
+ *
+ * The map allows `null` as a key.
*/
class LinkedHashMap<K, V> implements Map<K, V> {
external LinkedHashMap();
@@ -32,7 +43,9 @@ class LinkedHashMap<K, V> implements Map<K, V> {
external void forEach(void action (K key, V value));
+ /** The keys of the map, in insertion order. */
external Iterable<K> get keys;
+ /** The values of the map, in the order of their corresponding [keys].*/
external Iterable<V> get values;
external int get length;
« no previous file with comments | « sdk/lib/collection/hash_set.dart ('k') | sdk/lib/collection/linked_hash_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698