public class TreeNode
extends java.lang.Object
| Constructor and Description |
|---|
TreeNode() |
TreeNode(java.lang.Object o) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(TreeNode o)
Adds child node to this node.
|
java.lang.Object |
get()
Gets value of this node.
|
TreeNode |
get(int i)
Returns children i of this node.
|
java.util.List<TreeNode> |
getChildren() |
int |
getLevel() |
TreeNode |
getParent()
Returns parent of this node, if one exists.
|
boolean |
hasChild() |
boolean |
isLastChild() |
boolean |
isRoot() |
java.util.Iterator<TreeNode> |
iterator()
Returns iterator that goes through this tree in the following way: First
this node is given.
|
void |
set(java.lang.Object o)
Sets value of this node.
|
int |
size()
Gets amount of children in this node.
|
public TreeNode getParent()
public boolean isRoot()
public void add(TreeNode o)
o - TreeNode o is added as child to this node.public boolean hasChild()
public java.util.List<TreeNode> getChildren()
public boolean isLastChild()
public int size()
public TreeNode get(int i)
public void set(java.lang.Object o)
o - Value of this node is set to o.public java.lang.Object get()
public java.util.Iterator<TreeNode> iterator()
public int getLevel()
Copyright ? Technia AB. All Rights Reserved.