|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.iastate.jtm.dic.AbstractTrieNode
public abstract class AbstractTrieNode
Provide methods for all TrieNode.
| Field Summary | |
|---|---|
protected TrieNode[] |
children
Child node array. |
protected TrieNode |
parent
|
| Constructor Summary | |
|---|---|
AbstractTrieNode()
|
|
| Method Summary | |
|---|---|
int |
compareKey(java.lang.CharSequence str)
Compare a string to this node's key. |
TrieNode |
createChild(int id)
Create a new child node at the specified array index. |
abstract TrieNode[] |
createChildren()
Allocate memory for a node's child node array. |
protected abstract TrieNode |
createNodeInstance()
|
TrieNode[] |
getChildren()
Return a node's child node array. |
abstract int |
getDegree()
Return the degree of this trie (size of the trie's alphabet). |
abstract int |
getIndex(char c)
Return the index of a character in this node's child array. |
int |
getIndex(char[] key)
|
int |
getIndex(java.lang.CharSequence key)
|
char[] |
getKey()
Return a node's key. |
java.lang.String |
getKeyString()
|
TrieNode |
getParent()
|
java.lang.Object |
getValue()
Return a node's attached value. |
boolean |
isCaseSensitive()
|
void |
printIndexMapping()
|
void |
removeChild(int index)
|
void |
removeChildren()
|
void |
setKey(char[] k)
Set a node's key. |
void |
setParent(TrieNode parent)
|
void |
setValue(java.lang.Object obj)
Attach a value to the node. |
java.lang.String |
supportedCharacters()
Return supported characters by this TrieNode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TrieNode[] children
protected TrieNode parent
| Constructor Detail |
|---|
public AbstractTrieNode()
| Method Detail |
|---|
public int compareKey(java.lang.CharSequence str)
compareKey in interface TrieNodestr - the string to be compared.
public TrieNode createChild(int id)
createChild in interface TrieNodeid - the position in the array for the child node.
protected abstract TrieNode createNodeInstance()
public abstract TrieNode[] createChildren()
createChildren in interface TrieNodepublic TrieNode[] getChildren()
getChildren in interface TrieNodepublic TrieNode getParent()
getParent in interface TrieNodepublic void setParent(TrieNode parent)
setParent in interface TrieNodepublic abstract int getDegree()
getDegree in interface TrieNodepublic abstract int getIndex(char c)
getIndex in interface TrieNodec - the character of interest.
public int getIndex(char[] key)
getIndex in interface TrieNodepublic int getIndex(java.lang.CharSequence key)
getIndex in interface TrieNodepublic char[] getKey()
getKey in interface TrieNodepublic java.lang.Object getValue()
getValue in interface TrieNodepublic void setKey(char[] k)
setKey in interface TrieNodestr - the node's key.public void setValue(java.lang.Object obj)
setValue in interface TrieNodeobj - the value.public java.lang.String supportedCharacters()
supportedCharacters in interface TrieNodepublic void printIndexMapping()
printIndexMapping in interface TrieNodepublic void removeChild(int index)
removeChild in interface TrieNodepublic void removeChildren()
removeChildren in interface TrieNodepublic java.lang.String getKeyString()
getKeyString in interface TrieNodepublic boolean isCaseSensitive()
isCaseSensitive in interface TrieNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||