Trie<K, P extends Comparable<P>, V>.fromIterable constructor

Trie<K, P extends Comparable<P>, V>.fromIterable(
  1. Iterable<Object?> iterable, {
  2. required GetParts<K, P> parts,
  3. TrieNode<K, P, V>? root,
  4. K key(
    1. Object? element
    )?,
  5. V value(
    1. Object? element
    )?,
})

Creates a Trie from an iterable (and possible transformation functions). The parts define how the keys are computed and optionally provides a custom root node.

Implementation

factory Trie.fromIterable/*<E>*/(
  Iterable<Object?> /*Iterable<E>*/ iterable, {
  required GetParts<K, P> parts,
  TrieNode<K, P, V>? root,
  K Function(Object? /*E*/ element)? key,
  V Function(Object? /*E*/ element)? value,
}) =>
    Trie<K, P, V>.fromIterables(
        key == null ? iterable.cast<K>() : iterable.map(key),
        value == null ? iterable.cast<V>() : iterable.map(value),
        parts: parts,
        root: root);