public class SuffixTrie<V> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SuffixTrie.LookupResult<V>
Wrapper for results when a string is checked for suffixes contained in
the suffix trie.
|
protected static class |
SuffixTrie.Node<V> |
Modifier and Type | Field and Description |
---|---|
protected SuffixTrie.Node<V> |
root |
Constructor and Description |
---|
SuffixTrie() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String suffix)
Checks whether trie contains a suffix string.
|
V |
get(String suffix)
Get value associated with suffix string in trie.
|
protected SuffixTrie.LookupResult<V> |
getLongestSuffix(String string)
Match the longest suffix of a string contained in trie.
|
protected List<SuffixTrie.LookupResult<V>> |
getSuffixes(String string)
Match all suffixes of a string contained in trie.
|
V |
put(String suffix,
V value)
Insert a string and an associated value into the trie.
|
protected SuffixTrie.Node<V> root
public V put(String suffix, V value)
suffix
- suffix string inserted into trievalue
- value associated with stringpublic V get(String suffix)
suffix
- suffix string searched in triepublic boolean contains(String suffix)
suffix
- suffix string searched in trieprotected SuffixTrie.LookupResult<V> getLongestSuffix(String string)
string
- to be checked for a contained (longest) suffixprotected List<SuffixTrie.LookupResult<V>> getSuffixes(String string)
string
- string to be checked for suffixes contained in trieCopyright © 2009–2021 Crawler-Commons. All rights reserved.