|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
weka.core.Trie.TrieNode
public static class Trie.TrieNode
Represents a node in the trie.
| Field Summary | |
|---|---|
static Character |
STOP
the stop character |
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
EMPTY_ENUMERATION |
| Constructor Summary | |
|---|---|
Trie.TrieNode(char c)
initializes the node |
|
Trie.TrieNode(Character c)
initializes the node |
|
| Method Summary | |
|---|---|
boolean |
add(String suffix)
adds the given string to its children (creates children if necessary) |
Object |
clone()
creates a deep copy of itself |
boolean |
contains(String suffix)
checks whether a suffix can be found in its children |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
Trie.TrieNode |
find(String suffix)
returns the node with the given suffix |
Character |
getChar()
returns the stored character |
String |
getCommonPrefix()
returns the common prefix for all the nodes starting with this node. |
String |
getCommonPrefix(String startPrefix)
returns the common prefix for all the nodes starting with the node for the specified prefix. |
String |
getRevision()
Returns the revision string. |
String |
getString()
returns the full string up to the root |
boolean |
remove(String suffix)
Removes a suffix from the trie. |
void |
setChar(Character value)
sets the character this node represents |
int |
size()
returns the number of stored strings, i.e., leaves |
String |
toString()
returns the node in a string representation |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Character STOP
| Constructor Detail |
|---|
public Trie.TrieNode(char c)
c - the value of this nodepublic Trie.TrieNode(Character c)
c - the value of this node| Method Detail |
|---|
public Character getChar()
public void setChar(Character value)
value - the character to storepublic boolean add(String suffix)
suffix - the suffix to add to its children
public boolean remove(String suffix)
suffix - the suffix to remove
public boolean contains(String suffix)
suffix - the suffix to look for
public Object clone()
clone in class DefaultMutableTreeNodepublic boolean equals(Object obj)
equals in class Objectobj - the object to check for equality
public Trie.TrieNode find(String suffix)
suffix - the suffix to look for
public String getCommonPrefix()
public String getCommonPrefix(String startPrefix)
startPrefix - the prefix of the node to start the search from
public int size()
public String getString()
public String toString()
toString in class DefaultMutableTreeNodepublic String getRevision()
getRevision in interface RevisionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||