@Immutable @Beta public final class Trie extends Object
TrieMatcher
This is an implementation of trie designed to search for string constants.
It is a rather "naïve" implementation in that it is only a trie and not a much more sophisticated radix tree, but it is efficient enough that searching for a string among a series of strings is very fast.
The core of the trie search algorithm is implemented by TrieNode
.
Modifier and Type | Method and Description |
---|---|
int |
getMaxLength()
Get the maximum length of a match
|
int |
getNrWords()
Get the number of words injected into this trie
|
static TrieBuilder |
newBuilder()
Create a new builder for this class
|
int |
search(String needle,
boolean ignoreCase)
Search for a string into this trie
|
public static TrieBuilder newBuilder()
public int getNrWords()
public int getMaxLength()
public int search(String needle, boolean ignoreCase)
needle
- the string to search