org.apache.tapestry.contrib.tree.simple
Class TreeNode

java.lang.Object
  extended by org.apache.tapestry.contrib.tree.simple.TreeNode
All Implemented Interfaces:
Serializable, IMutableTreeNode, ITreeNode

public class TreeNode
extends Object
implements IMutableTreeNode

Version:
$Id: TreeNode.java 243791 2004-02-19 17:38:13Z hlship $
Author:
ceco
See Also:
Serialized Form

Field Summary
protected  IMutableTreeNode m_objParentNode
           
protected  Set m_setChildren
           
 
Constructor Summary
TreeNode()
          Constructor for TreeNode.
TreeNode(IMutableTreeNode parentNode)
           
 
Method Summary
 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.
 Collection getChildren()
          Returns the Collection of children.
 ITreeNode getParent()
          Returns the parent ITreeNode of the receiver.
 void insert(Collection colChildren)
          Adds collection ofchildren 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_setChildren

protected Set m_setChildren

m_objParentNode

protected IMutableTreeNode m_objParentNode
Constructor Detail

TreeNode

public TreeNode()
Constructor for TreeNode.


TreeNode

public TreeNode(IMutableTreeNode parentNode)
Method Detail

getChildCount

public int getChildCount()
Description copied from interface: ITreeNode
Returns the number of children ITreeNodes the receiver contains.

Specified by:
getChildCount in interface ITreeNode

getParent

public ITreeNode getParent()
Description copied from interface: ITreeNode
Returns the parent ITreeNode of the receiver.

Specified by:
getParent in interface ITreeNode

getAllowsChildren

public boolean getAllowsChildren()
Description copied from interface: ITreeNode
Returns true if the receiver allows children.

Specified by:
getAllowsChildren in interface ITreeNode

isLeaf

public boolean isLeaf()
Description copied from interface: ITreeNode
Returns true if the receiver is a leaf.

Specified by:
isLeaf in interface ITreeNode

children

public Collection children()

insert

public void insert(IMutableTreeNode child)

remove

public void remove(IMutableTreeNode node)
Description copied from interface: IMutableTreeNode
Removes node from the receiver. setParent will be messaged on node.

Specified by:
remove in interface IMutableTreeNode

removeFromParent

public void removeFromParent()
Description copied from interface: IMutableTreeNode
Removes the receiver from its parent.

Specified by:
removeFromParent in interface IMutableTreeNode

setParent

public void setParent(IMutableTreeNode newParent)
Description copied from interface: IMutableTreeNode
Sets the parent of the receiver to newParent.

Specified by:
setParent in interface IMutableTreeNode

insert

public void insert(Collection colChildren)
Description copied from interface: IMutableTreeNode
Adds collection ofchildren to the receiver. Child will be messaged with setParent.

Specified by:
insert in interface IMutableTreeNode

containsChild

public boolean containsChild(ITreeNode node)
Description copied from interface: ITreeNode
Returns the true if current node contains received children, otherwise return false;

Specified by:
containsChild in interface ITreeNode
See Also:
ITreeNode.containsChild(ITreeNode)

getChildren

public Collection getChildren()
Description copied from interface: ITreeNode
Returns the Collection of children.

Specified by:
getChildren in interface ITreeNode
See Also:
ITreeNode.getChildren()