public class TrieBuilder<T>
extends java.lang.Object
| Constructor and Description |
|---|
TrieBuilder() |
| Modifier and Type | Method and Description |
|---|---|
TrieBuilder<T> |
add(java.lang.String word,
T value)
Add a word-value mapping to the Trie.
|
TrieBuilder<T> |
addAll(java.util.Map<java.lang.String,T> map)
Add all word-value pairs from the given map to the Trie.
|
Trie<T> |
build() |
TrieBuilder<T> |
set(java.lang.String word,
T value)
Set a word-value mapping on the Trie.
|
TrieBuilder<T> |
setAll(java.util.Map<java.lang.String,T> map)
Set all word-value pairs in the given map to the Trie.
|
public TrieBuilder<T> add(java.lang.String word, T value)
word - The word for the word-value mapping.value - The value for the word-value mapping.this, for chaining.java.lang.IllegalStateException - If this Trie already contained a mapping for the given word.public TrieBuilder<T> addAll(java.util.Map<java.lang.String,T> map)
map - Map to add word-value pairs from.this, for chaining.java.lang.IllegalStateException - If this Trie already contained a mapping for any of the map's words (keys).public TrieBuilder<T> set(java.lang.String word, T value)
word - The word for the word-value mapping.value - The value for the word-value mapping.this, for chaining.public TrieBuilder<T> setAll(java.util.Map<java.lang.String,T> map)
map - Map to set word-value pairs from.this, for chaining.public Trie<T> build()
Trie created from the word-value mappings in this TrieBuilder.