W3cubDocs

/Dart 2

SplayTreeSet<E>.of constructor

SplayTreeSet<E>.of(Iterable<E> elements, [ int compare(E key1, E key2), bool isValidKey(dynamic potentialKey) ])

Creates a SplayTreeSet from elements.

The set works as if created by new SplayTreeSet<E>(compare, isValidKey).

All the elements should be valid as arguments to the compare function.

Implementation

factory SplayTreeSet.of(Iterable<E> elements,
        [int compare(E key1, E key2), bool isValidKey(potentialKey)]) =>
    new SplayTreeSet(compare, isValidKey)..addAll(elements);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-collection/SplayTreeSet/SplayTreeSet.of.html