|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.infrared.agent.util.TreeNode
Implementation of a TreeNode that represents a single node in a Tree
| Constructor Summary | |
TreeNode()
Default constructor - required for handling mapping to XML |
|
| Method Summary | |
void |
addChild(TreeNode child)
Add a new child node to the end of the list |
void |
addChildren(List children)
|
static TreeNode |
createTreeNode(Object value)
Factory method to create tree nodes |
TreeNode |
find(Object value)
|
List |
getChildren()
Return the list of child nodes |
int |
getDepth()
Returns the depth at which this node appears in a tree. |
TreeNode |
getParent()
Returns the parent node |
int |
getPosition()
Returns the position the node occupies among the children of the parent node. |
Object |
getValue()
Get the value associated with this TreeNode |
boolean |
removeChild(TreeNode child)
|
void |
setParent(TreeNode parentNode)
Set the parent for this node |
String |
toString()
|
void |
traverseBreadthFirst(NodeVisitor visitor)
traverse the tree (starting at this node) breadth first |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TreeNode()
| Method Detail |
public static TreeNode createTreeNode(Object value)
value -
public Object getValue()
public List getChildren()
public void addChild(TreeNode child)
child - - child node shouldn't be nullpublic boolean removeChild(TreeNode child)
public void setParent(TreeNode parentNode)
parentNode - public TreeNode getParent()
public void traverseBreadthFirst(NodeVisitor visitor)
visitor - public TreeNode find(Object value)
public int getDepth()
public int getPosition()
public void addChildren(List children)
public String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||