beowulf.model.tree
Class BinaryTreeNode
java.lang.Object
beowulf.model.tree.BinaryTreeNode
- All Implemented Interfaces:
- MutableTreeNode, TreeNode
- public class BinaryTreeNode
- extends Object
- implements MutableTreeNode
- Version:
- 1.0, 11/15/2003
- Author:
- Andy Scukanec (ags at cs dot cornell dot edu)
LEFT_NODE
public static final int LEFT_NODE
- See Also:
- Constant Field Values
RIGHT_NODE
public static final int RIGHT_NODE
- See Also:
- Constant Field Values
parent
protected BinaryTreeNode parent
- Holds a reference to the parent node.
value
protected Object value
- Holds the a reference to the value of this node.
left
protected BinaryTreeNode left
- Holds a reference to the left child.
right
protected BinaryTreeNode right
- Holds a reference to the right child.
BinaryTreeNode
public BinaryTreeNode(Object newValue)
getUserObject
public Object getUserObject()
getParent
public TreeNode getParent()
- Specified by:
getParent in interface TreeNode
getChildCount
public int getChildCount()
- Specified by:
getChildCount in interface TreeNode
children
public Enumeration children()
- Specified by:
children in interface TreeNode
getAllowsChildren
public boolean getAllowsChildren()
- Specified by:
getAllowsChildren in interface TreeNode
getChildAt
public TreeNode getChildAt(int index)
- Specified by:
getChildAt in interface TreeNode
getLeft
public BinaryTreeNode getLeft()
getRight
public BinaryTreeNode getRight()
getIndex
public int getIndex(TreeNode node)
- Specified by:
getIndex in interface TreeNode
isLeaf
public boolean isLeaf()
- Specified by:
isLeaf in interface TreeNode
insert
public void insert(MutableTreeNode child,
int index)
- Specified by:
insert in interface MutableTreeNode
setLeft
public void setLeft(BinaryTreeNode node)
setRight
public void setRight(BinaryTreeNode node)
removeFromParent
public void removeFromParent()
- Specified by:
removeFromParent in interface MutableTreeNode
remove
public void remove(int index)
- Specified by:
remove in interface MutableTreeNode
remove
public void remove(MutableTreeNode oldChild)
- Specified by:
remove in interface MutableTreeNode
setParent
public void setParent(MutableTreeNode newParent)
- Specified by:
setParent in interface MutableTreeNode
setUserObject
public void setUserObject(Object newValue)
- Specified by:
setUserObject in interface MutableTreeNode
toString
public String toString()