Chromium Code Reviews| Index: sdk/lib/collection/linked_hash_set.dart |
| diff --git a/sdk/lib/collection/linked_hash_set.dart b/sdk/lib/collection/linked_hash_set.dart |
| index ee9cdb14e2eac704fcfebb5515b2b9065bbd28d3..9e97fcc873253b32cd3acb72ec62e15067b9683e 100644 |
| --- a/sdk/lib/collection/linked_hash_set.dart |
| +++ b/sdk/lib/collection/linked_hash_set.dart |
| @@ -4,6 +4,23 @@ |
| part of dart.collection; |
| +/** |
| + * A [LinkedHashSet] is a hash-table based [Set] implementation. |
| + * |
| + * The `LinkedHashSet` also keep track of the order that elements were inserted |
|
ngeoffray
2013/06/04 11:51:33
keep -> keeps
|
| + * in, and iteration happens in first-to-last insertion order. |
| + * |
| + * The elements of a `LinkedHashSet` must have consistent [Object.operator==] |
| + * and [Object.hashCode] implementations. This means that the `==` operator |
| + * must define a stable equivalence relation on the elements (reflexive, |
| + * anti-symmetric, trasitive, and consistent over time), and that `hashCode` |
|
ngeoffray
2013/06/04 11:51:33
trasitive -> transitive
|
| + * must be the same for objects that are considered equal by `==`. |
| + * |
| + * The set allows `null` as an element. |
| + * |
| + * Most simple operations on `HashSet` are done in constant time: [add], |
| + * [contains], [remove], and [length]. |
| + */ |
| class LinkedHashSet<E> extends _HashSetBase<E> { |
| external LinkedHashSet(); |
| @@ -13,6 +30,8 @@ class LinkedHashSet<E> extends _HashSetBase<E> { |
| } |
| // Iterable. |
| + |
| + /** Return an iterator that iterates over elements in insertion order. */ |
| external Iterator<E> get iterator; |
| external int get length; |
| @@ -23,6 +42,7 @@ class LinkedHashSet<E> extends _HashSetBase<E> { |
| external bool contains(Object object); |
| + /** Perform an operation on each element in insertion order. */ |
| external void forEach(void action(E element)); |
| external E get first; |