Trie<T> class
Constructors
-
Trie.new({List<MapEntry<String, T>>? initialData})
-
Constructor to initialize the Trie. Optionally, you can provide initial data.
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
root
→ TrieNode<T>
-
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear()
→ void
-
Clears the trie by deleting all entries.
-
getDetailsWithPrefix(String prefix)
→ Set<T>
-
Retrieves all details for words that start with the given prefix.
Returns a Set of details associated with matching words.
-
insert(String word, T details)
→ void
-
Inserts a word into the trie with associated details.
The details are stored at the end of the word.
-
insertAll(List<MapEntry<String, T>> data)
→ void
-
Inserts multiple words with their associated details.
This is done by calling
insert
on each key-value pair.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited