|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.iastate.jtm.dic.Trie
public class Trie
An implementation of trie data structure.
| Constructor Summary | |
|---|---|
Trie(TrieNode rt)
Creates a new instance of Trie. |
|
| Method Summary | |
|---|---|
void |
clear()
Remove all child nodes. |
java.lang.Object |
get(java.lang.String key)
Find and return the value associated with a key. |
java.lang.String |
getCompleteKey(TrieNode leaf)
|
TrieNode |
getRoot()
Return the root node. |
TrieNode |
incrementalGet(java.lang.CharSequence key,
TrieNode rt)
Find and return the node of a specific key. |
boolean |
isCaseSensitive()
|
java.util.Enumeration |
keys()
|
void |
print(java.io.PrintStream ps,
boolean printValue)
Print all entries in this trie. |
void |
put(java.lang.CharSequence key,
java.lang.Object val,
boolean replace)
Put a key and value pair in the trie. |
void |
put(java.lang.String key,
java.lang.Object val)
Put a key and value pair in the trie. |
java.lang.Object |
remove(java.lang.CharSequence key)
Remove an entry from the trie. |
int |
size()
Return the number of entries in this trie. |
java.lang.String[] |
splitKey(java.lang.String key)
Split a string into keys in the trie (greedy). |
java.lang.String[] |
splitKey(java.lang.String key,
boolean greedy)
Split a string into keys in the trie. |
java.lang.String |
supportedCharacters()
Return supported characters by this Trie. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Trie(TrieNode rt)
rt - the root node of the trie.| Method Detail |
|---|
public TrieNode getRoot()
public void put(java.lang.String key,
java.lang.Object val)
key - the key.val - the value.
public void put(java.lang.CharSequence key,
java.lang.Object val,
boolean replace)
key - the key.val - the value.replace - replace the old value if true.public java.lang.Object remove(java.lang.CharSequence key)
key - key of the entry to be removed
public void clear()
public TrieNode incrementalGet(java.lang.CharSequence key,
TrieNode rt)
key - the keyrt - the node to start the search.
public java.lang.String getCompleteKey(TrieNode leaf)
public java.lang.Object get(java.lang.String key)
key - the key.
public java.lang.String[] splitKey(java.lang.String key,
boolean greedy)
key - the string to be splitted.greedy - greedy or reluctant split.
public java.lang.String[] splitKey(java.lang.String key)
key - the string to be splitted.
public java.lang.String supportedCharacters()
public boolean isCaseSensitive()
public int size()
public java.util.Enumeration keys()
public void print(java.io.PrintStream ps,
boolean printValue)
ps - output destination.printValue - Whether or not print associated values.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||