public class TreeNode extends java.lang.Object implements IMutableTreeNode
| Modifier and Type | Field and Description |
|---|---|
protected IMutableTreeNode |
m_objParentNode |
protected java.util.Set |
m_setChildren |
| Constructor and Description |
|---|
TreeNode()
Constructor for TreeNode.
|
TreeNode(IMutableTreeNode parentNode) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection |
children() |
boolean |
containsChild(ITreeNode node)
Returns the true if current node contains received children, otherwise return false;
|
boolean |
getAllowsChildren()
Returns true if the receiver allows children.
|
int |
getChildCount()
Returns the number of children
ITreeNodes the receiver
contains. |
java.util.Collection |
getChildren()
Returns the
Collection of children. |
ITreeNode |
getParent()
Returns the parent
ITreeNode of the receiver. |
void |
insert(java.util.Collection colChildren)
Adds collection of
children to the receiver. |
void |
insert(IMutableTreeNode child) |
boolean |
isLeaf()
Returns true if the receiver is a leaf.
|
void |
remove(IMutableTreeNode node)
Removes
node from the receiver. |
void |
removeFromParent()
Removes the receiver from its parent.
|
void |
setParent(IMutableTreeNode newParent)
Sets the parent of the receiver to
newParent. |
protected java.util.Set m_setChildren
protected IMutableTreeNode m_objParentNode
public TreeNode()
public TreeNode(IMutableTreeNode parentNode)
public int getChildCount()
ITreeNodeITreeNodes the receiver
contains.getChildCount in interface ITreeNodepublic ITreeNode getParent()
ITreeNodeITreeNode of the receiver.public boolean getAllowsChildren()
ITreeNodegetAllowsChildren in interface ITreeNodepublic boolean isLeaf()
ITreeNodepublic java.util.Collection children()
public void insert(IMutableTreeNode child)
public void remove(IMutableTreeNode node)
IMutableTreeNodenode from the receiver. setParent
will be messaged on node.remove in interface IMutableTreeNodepublic void removeFromParent()
IMutableTreeNoderemoveFromParent in interface IMutableTreeNodepublic void setParent(IMutableTreeNode newParent)
IMutableTreeNodenewParent.setParent in interface IMutableTreeNodepublic void insert(java.util.Collection colChildren)
IMutableTreeNodechildren to the receiver.
Child will be messaged with setParent.insert in interface IMutableTreeNodepublic boolean containsChild(ITreeNode node)
ITreeNodecontainsChild in interface ITreeNodeITreeNode.containsChild(ITreeNode)public java.util.Collection getChildren()
ITreeNodeCollection of children.getChildren in interface ITreeNodeITreeNode.getChildren()