|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TreeNode<T>
Interface representing tree ADT nodes
| Method Summary | |
|---|---|
void |
addChild(java.lang.Object identifier,
TreeNode<T> child)
adds child to children collection |
TreeNode<T> |
getChild(java.lang.Object id)
find child by id Please see getChildren() for more information about identifier constraints. |
java.util.Iterator<java.util.Map.Entry<java.lang.Object,TreeNode<T>>> |
getChildren()
Getter for children entries. |
T |
getData()
getter for node attached data |
TreeNode<T> |
getParent()
getter for parent TreeNode |
boolean |
isLeaf()
Returns whether this node is leaf |
void |
removeChild(java.lang.Object id)
Please see getChildren() for more information about identifier constraints. |
void |
setData(T data)
setter for node attached data |
void |
setParent(TreeNode<T> parent)
setter for parent TreeNode |
| Method Detail |
|---|
T getData()
void setData(T data)
data - data to set as attached node databoolean isLeaf()
true if this node is leaf else returns falsejava.util.Iterator<java.util.Map.Entry<java.lang.Object,TreeNode<T>>> getChildren()
Object.toString() representations of identifier separated with
NamingContainer.SEPARATOR_CHAR chars. String representation of identifier
should be a valid XML ID, e.g. conform to this:
XML Name Production
production.
Iterator of Map.Entry instances containing TreeNode as values
and their identifiers as keys.TreeNode<T> getChild(java.lang.Object id)
getChildren() for more information about identifier constraints.
id - identifier of the child to find
TreeNode instance or null
void addChild(java.lang.Object identifier,
TreeNode<T> child)
identifier - child identifier.
Please see getChildren() for more information about identifier constraints.child - childvoid removeChild(java.lang.Object id)
getChildren() for more information about identifier constraints.
removes child from children collection by child id
id - id of the child to removeTreeNode<T> getParent()
TreeNode
TreeNode instance or null if this node is 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 | |||||||||