程序包 weka.core
类 Trie.TrieNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
weka.core.Trie.TrieNode
- 所有已实现的接口:
Serializable
,Cloneable
,MutableTreeNode
,TreeNode
,RevisionHandler
- 封闭类:
- Trie
Represents a node in the trie.
- 版本:
- $Revision: 1.2 $
- 作者:
- fracpete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
字段概要
字段从类继承的字段 javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
adds the given string to its children (creates children if necessary)clone()
creates a deep copy of itselfboolean
checks whether a suffix can be found in its childrenboolean
Indicates whether some other object is "equal to" this one.returns the node with the given suffixgetChar()
returns the stored characterreturns the common prefix for all the nodes starting with this node.getCommonPrefix
(String startPrefix) returns the common prefix for all the nodes starting with the node for the specified prefix.Returns the revision string.returns the full string up to the rootboolean
Removes a suffix from the trie.void
sets the character this node representsint
size()
returns the number of stored strings, i.e., leavestoString()
returns the node in a string representation从类继承的方法 javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
-
字段详细资料
-
STOP
the stop character
-
-
构造器详细资料
-
TrieNode
public TrieNode(char c) initializes the node- 参数:
c
- the value of this node
-
TrieNode
initializes the node- 参数:
c
- the value of this node
-
-
方法详细资料
-
getChar
returns the stored character- 返回:
- the stored character
-
setChar
sets the character this node represents- 参数:
value
- the character to store
-
add
adds the given string to its children (creates children if necessary)- 参数:
suffix
- the suffix to add to its children- 返回:
- true if the add operation changed the structure
-
remove
Removes a suffix from the trie.- 参数:
suffix
- the suffix to remove- 返回:
- true if this trie changed as a result of the call
-
contains
checks whether a suffix can be found in its children- 参数:
suffix
- the suffix to look for- 返回:
- true if suffix was found
-
clone
creates a deep copy of itself- 覆盖:
clone
在类中DefaultMutableTreeNode
- 返回:
- a deep copy of itself
-
equals
Indicates whether some other object is "equal to" this one. -
find
returns the node with the given suffix- 参数:
suffix
- the suffix to look for- 返回:
- null if unsuccessful otherwise the corresponding node
-
getCommonPrefix
returns the common prefix for all the nodes starting with this node. The result includes this node, unless it's the root node or a STOP node.- 返回:
- the result of the search
-
getCommonPrefix
returns the common prefix for all the nodes starting with the node for the specified prefix. Can be null if initial prefix is not found. The result includes this node, unless it's the root node or a STOP node. Using the empty string means starting with this node.- 参数:
startPrefix
- the prefix of the node to start the search from- 返回:
- the result of the search, null if startPrefix cannot be found
-
size
public int size()returns the number of stored strings, i.e., leaves- 返回:
- the number of stored strings
-
getString
returns the full string up to the root- 返回:
- the full string to the root
-
toString
returns the node in a string representation- 覆盖:
toString
在类中DefaultMutableTreeNode
- 返回:
- the node as string
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-