|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of node.public interface TreeNode<T>
A TreeNode to define a tree data structure.
Method Summary | |
---|---|
void |
addChild(Object identifier,
TreeNode<T> child)
Adds a child to the children. |
TreeNode<T> |
getChild(Object id)
Find a child by id. |
Iterator<Map.Entry<Object,TreeNode<T>>> |
getChildren()
Get all child entries. |
T |
getData()
Get the data of the node. |
TreeNode<T> |
getParent()
Get the parent TreeNode . |
boolean |
isLeaf()
Return whether this node is leaf. |
void |
removeChild(Object id)
Removes a child from the children collection. |
void |
setData(T data)
Set the data of the node. |
void |
setParent(TreeNode<T> parent)
Set the parent TreeNode . |
Method Detail |
---|
T getData()
void setData(T data)
data
- Data to setboolean isLeaf()
true
if this node is leaf, otherwise
false
Iterator<Map.Entry<Object,TreeNode<T>>> getChildren()
Iterator
over Map.Entry instances containing
TreeNode
as values and their identifiers as keysTreeNode<T> getChild(Object id)
See getChildren()
for more information about the identifier
constraints.
id
- The identifier of the child to find
TreeNode
instance or null
void addChild(Object identifier, TreeNode<T> child)
See getChildren()
for more information about identifier
constraints.
identifier
- child identifierchild
- The childvoid removeChild(Object id)
See getChildren()
for more information about identifier
constraints.
id
- The id of the child to removeTreeNode<T> getParent()
TreeNode
.
TreeNode
instance or null
if the node
is the rootvoid setParent(TreeNode<T> parent)
TreeNode
.
parent
- TreeNode
to set as parent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |