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

Trie<K, P extends Comparable<P>, V>.fromMap(
  1. Map<K, V> other, {
  2. required GetParts<K, P> parts,
  3. TrieNode<K, P, V>? root,
})

Creates a Trie from a Map. The parts define how the keys are computed and optionally provides a custom root node.

Implementation

factory Trie.fromMap(Map<K, V> other,
    {required GetParts<K, P> parts, TrieNode<K, P, V>? root}) {
  final result = Trie<K, P, V>(parts: parts, root: root);
  result.addAll(other);
  return result;
}