org.jikesrvm.compilers.opt.util
Class TreeNode

java.lang.Object
  extended by org.jikesrvm.compilers.opt.util.TreeNode
Direct Known Subclasses:
CallSiteTreeNode, DominatorTreeNode

public class TreeNode
extends Object

This class is a node in a tree. Both up and down pointers are used.


Field Summary
private  TreeNode leftChild
          The first (leftmost) child
private  TreeNode parent
          The parent of this node
private  TreeNode rightSibling
          The next node on the child list that I am on
 
Constructor Summary
TreeNode()
          Constructor
 
Method Summary
 void addChild(TreeNode node)
          adds a child to this node
 void clear()
          Sets all tree pointers to null
 Enumeration<TreeNode> getChildren()
           
 TreeNode getLeftChild()
          returns the first child of this node
 TreeNode getParent()
          return the parent of this node
 TreeNode getRightSibling()
          returns the next node with the same parent as me
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private TreeNode parent
The parent of this node


leftChild

private TreeNode leftChild
The first (leftmost) child


rightSibling

private TreeNode rightSibling
The next node on the child list that I am on

Constructor Detail

TreeNode

public TreeNode()
Constructor

Method Detail

getParent

public TreeNode getParent()
return the parent of this node

Returns:
my parent

getLeftChild

public TreeNode getLeftChild()
returns the first child of this node

Returns:
the first child of this node

getRightSibling

public TreeNode getRightSibling()
returns the next node with the same parent as me

Returns:
the next node with the same parent as me

addChild

public void addChild(TreeNode node)
adds a child to this node

Parameters:
node - the new child

clear

public void clear()
Sets all tree pointers to null


getChildren

public Enumeration<TreeNode> getChildren()