mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 15:50:01 +00:00
Improve document for HashSet.
See #28083 (http://dartbug.com/28083) R=lrn@google.com Review-Url: https://codereview.chromium.org/2567393002 .
This commit is contained in:
parent
cc2b071743
commit
7ee023d2ed
|
@ -45,9 +45,14 @@ abstract class _HashSetBase<E> extends SetBase<E> {
|
|||
*
|
||||
* The set allows `null` as an element.
|
||||
*
|
||||
* Most simple operations on `HashSet` are done in (potentially amorteized)
|
||||
* Most simple operations on `HashSet` are done in (potentially amortized)
|
||||
* constant time: [add], [contains], [remove], and [length], provided the hash
|
||||
* codes of objects are well distributed.
|
||||
*
|
||||
* The iteration order of the set is not specified and depends on
|
||||
* the hashcodes of the provided elements. However, the order is stable:
|
||||
* multiple iterations over the same set produce the same order, as long as
|
||||
* the set is not modified.
|
||||
*/
|
||||
abstract class HashSet<E> implements Set<E> {
|
||||
/**
|
||||
|
@ -108,8 +113,10 @@ abstract class HashSet<E> implements Set<E> {
|
|||
/**
|
||||
* Create a hash set containing all [elements].
|
||||
*
|
||||
* Creates a hash set as by `new HashSet<E>()` and adds each element of
|
||||
* `elements` to this set in the order they are iterated.
|
||||
* Creates a hash set as by `new HashSet<E>()` and adds all given [elements]
|
||||
* to the set. The elements are added in order. If [elements] contains
|
||||
* two entries that are equal, but not identical, then the first one is
|
||||
* the one in the resulting set.
|
||||
*
|
||||
* All the [elements] should be assignable to [E].
|
||||
* The `elements` iterable itself may have any element type, so this
|
||||
|
|
Loading…
Reference in a new issue