public class DefaultMutableTreeNode extends java.lang.Object implements MutableTreeNode
MutableTreeNode.| Constructor and Description |
|---|
DefaultMutableTreeNode(java.util.List children,
boolean allowsChildren) |
DefaultMutableTreeNode(java.lang.Object userObject) |
DefaultMutableTreeNode(java.lang.Object userObject,
MutableTreeNode parent,
boolean allowsChildren) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Iterator |
children()
Answer the children of the receiver.
|
boolean |
getAllowsChildren()
Answer true if this node allows children.
|
TreeNode |
getChildAt(int index)
Answer the child at the given index.
|
int |
getChildCount()
Answer the number of children this node contains.
|
int |
getIndex(TreeNode node)
Answer the index of the given node in this node's children.
|
TreeNode |
getParent()
Answer the parent of this node.
|
java.lang.Object |
getUserObject() |
void |
insert(MutableTreeNode child)
Add the given child to the children of this node.
|
void |
insert(MutableTreeNode child,
int index)
Add the given child to the children of this node at index.
|
boolean |
isLeaf()
Answer true if this is a leaf node.
|
void |
remove(int index)
Remove the child at the given index.
|
void |
remove(MutableTreeNode node)
Remove the given node.
|
void |
removeFromParent()
Remove this node from its parent.
|
void |
setParent(MutableTreeNode parent)
Set the parent node.
|
void |
setUserObject(java.lang.Object object)
Sets the user object of this node.
|
java.lang.String |
toString() |
public DefaultMutableTreeNode(java.lang.Object userObject)
userObject - The userObject.public DefaultMutableTreeNode(java.util.List children,
boolean allowsChildren)
children - The children.allowsChildren - The allowsChildren.public DefaultMutableTreeNode(java.lang.Object userObject,
MutableTreeNode parent,
boolean allowsChildren)
userObject - The userobject.parent - The parent.allowsChildren - The allowsChildren.public void insert(MutableTreeNode child)
MutableTreeNodeinsert in interface MutableTreeNodeMutableTreeNode.insert(org.apache.myfaces.custom.tree.MutableTreeNode)public void insert(MutableTreeNode child, int index)
MutableTreeNodeinsert in interface MutableTreeNodeMutableTreeNode.insert(org.apache.myfaces.custom.tree.MutableTreeNode, int)public void remove(int index)
MutableTreeNoderemove in interface MutableTreeNodeMutableTreeNode.remove(int)public void remove(MutableTreeNode node)
MutableTreeNoderemove in interface MutableTreeNodeMutableTreeNode.remove(org.apache.myfaces.custom.tree.MutableTreeNode)public void setUserObject(java.lang.Object object)
MutableTreeNodesetUserObject in interface MutableTreeNodeMutableTreeNode.setUserObject(java.lang.Object)public java.lang.Object getUserObject()
getUserObject in interface TreeNodeTreeNode.getUserObject()public void removeFromParent()
MutableTreeNoderemoveFromParent in interface MutableTreeNodeMutableTreeNode.removeFromParent()public void setParent(MutableTreeNode parent)
MutableTreeNodesetParent in interface MutableTreeNodeMutableTreeNode.setParent(org.apache.myfaces.custom.tree.MutableTreeNode)public TreeNode getChildAt(int index)
TreeNodegetChildAt in interface TreeNodeTreeNode.getChildAt(int)public int getChildCount()
TreeNodegetChildCount in interface TreeNodeTreeNode.getChildCount()public TreeNode getParent()
TreeNodegetParent in interface TreeNodeTreeNode.getParent()public int getIndex(TreeNode node)
TreeNodegetIndex in interface TreeNodeTreeNode.getIndex(org.apache.myfaces.custom.tree.TreeNode)public boolean getAllowsChildren()
TreeNodegetAllowsChildren in interface TreeNodeTreeNode.getAllowsChildren()public boolean isLeaf()
TreeNodeisLeaf in interface TreeNodeTreeNode.isLeaf()public java.util.Iterator children()
TreeNodechildren in interface TreeNodeTreeNode.children()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()