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
ITreeNode s 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()
ITreeNode
ITreeNode
s the receiver
contains.getChildCount
in interface ITreeNode
public ITreeNode getParent()
ITreeNode
ITreeNode
of the receiver.public boolean getAllowsChildren()
ITreeNode
getAllowsChildren
in interface ITreeNode
public boolean isLeaf()
ITreeNode
public java.util.Collection children()
public void insert(IMutableTreeNode child)
public void remove(IMutableTreeNode node)
IMutableTreeNode
node
from the receiver. setParent
will be messaged on node
.remove
in interface IMutableTreeNode
public void removeFromParent()
IMutableTreeNode
removeFromParent
in interface IMutableTreeNode
public void setParent(IMutableTreeNode newParent)
IMutableTreeNode
newParent
.setParent
in interface IMutableTreeNode
public void insert(java.util.Collection colChildren)
IMutableTreeNode
children
to the receiver.
Child
will be messaged with setParent
.insert
in interface IMutableTreeNode
public boolean containsChild(ITreeNode node)
ITreeNode
containsChild
in interface ITreeNode
ITreeNode.containsChild(ITreeNode)
public java.util.Collection getChildren()
ITreeNode
Collection
of children.getChildren
in interface ITreeNode
ITreeNode.getChildren()