Abstract
Abstract
sizeGets the number of entries stored in the trie-map.
The total count of word-value pairs.
Abstract
[iterator]Makes the AbstractTrieMap
iterable.
If true
, entries are yielded in reverse insertion order.
An iterator for the trie-map's entries.
Abstract
clearRemoves all entries from the trie-map, resetting it to an empty state.
Abstract
deleteRemoves an entry from the trie-map.
The key of the entry to remove.
true
if the entry was found and removed, false
if not found.
Abstract
entriesReturns an iterator for the entries in the trie-map.
If true
, entries are yielded in reverse order.
An iterator of the trie's entries.
Abstract
findFinds all entries whose keys start with the given prefix.
The prefix to search for.
An array of matching [word, value]
pairs.
Abstract
forExecutes a callback function for each entry in the trie-map.
The value of the current entry.
The word of the current entry.
The trie-map instance being traversed.
Optional
thisArg: anyAbstract
getRetrieves the value associated with a given key.
The key to look up.
The associated value if found, undefined
otherwise.
Abstract
hasChecks if an entry with the specified key exists in the trie-map.
The key to check.
true
if an entry with the key exists, false
otherwise.
Abstract
keysReturns an iterator for the keys of the entries in the trie-map.
If true
, keys are yielded in reverse order.
An iterator of the trie-map's entries keys.
Abstract
setAdds or updates an entry in the trie-map.
The key for the entry.
The value to associate with the key.
Abstract
valuesReturns an iterator for the values of the entries in the trie-map.
If true
, values are yielded in reverse order.
An iterator of the trie-map's entries values.
Abstract base class for implementing trie-based map data structures. Provides the core interface for associating values with string keys efficiently.
A trie-map combines the prefix-matching capabilities of tries with key-value storage, similar to how a
Map
associates values with keys, but optimized for string-based keys.Example