|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openwms.core.util.TreeNodeImpl<T>
T
- The type of the nodepublic class TreeNodeImpl<T>
A TreeNodeImpl is a simple implementation of a TreeNode
.
Constructor Summary | |
---|---|
TreeNodeImpl()
|
Method Summary | |
---|---|
void |
addChild(Object identifier,
TreeNode<T> child)
Adds a child to the children. |
TreeNode<T> |
getChild(Object identifier)
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 identifier)
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 . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeNodeImpl()
Method Detail |
---|
public T getData()
getData
in interface TreeNode<T>
public TreeNode<T> getChild(Object identifier)
See TreeNode.getChildren()
for more information about the identifier
constraints.
getChild
in interface TreeNode<T>
identifier
- The identifier of the child to find
TreeNode
instance or null
public void addChild(Object identifier, TreeNode<T> child)
See TreeNode.getChildren()
for more information about identifier
constraints.
addChild
in interface TreeNode<T>
identifier
- child identifierchild
- The childpublic void removeChild(Object identifier)
See TreeNode.getChildren()
for more information about identifier
constraints.
removeChild
in interface TreeNode<T>
identifier
- The id of the child to removepublic void setData(T data)
setData
in interface TreeNode<T>
data
- Data to setpublic TreeNode<T> getParent()
TreeNode
.
getParent
in interface TreeNode<T>
TreeNode
instance or null
if the node
is the rootpublic void setParent(TreeNode<T> parent)
TreeNode
.
setParent
in interface TreeNode<T>
parent
- TreeNode
to set as parentpublic Iterator<Map.Entry<Object,TreeNode<T>>> getChildren()
getChildren
in interface TreeNode<T>
Iterator
over Map.Entry instances containing
TreeNode
as values and their identifiers as keyspublic boolean isLeaf()
isLeaf
in interface TreeNode<T>
true
if this node is leaf, otherwise
false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |