public class TrieNode<T> extends Object
| Constructor and Description |
|---|
TrieNode(Comparator<T> comparator)
Constructor for top level root node.
|
TrieNode(Comparator<T> comparator,
T character)
Constructor for child node.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addWord(List<T> word)
Adds a word to this node.
|
protected TrieNode<T> |
getNode(T c)
Returns the child TrieNode representing the given char, or null if no
node exists.
|
protected List<List<T>> |
getWords()
Returns a List of String objects which are lower in the hierarchy that
this node.
|
String |
toString() |
public TrieNode(Comparator<T> comparator)
public TrieNode(Comparator<T> comparator, T character)
protected void addWord(List<T> word)
word - the word to addprotected TrieNode<T> getNode(T c)
c - protected List<List<T>> getWords()
Copyright © 2016. All rights reserved.