calculation
Class TreeNode

java.lang.Object
  extended by calculation.TreeNode

public class TreeNode
extends java.lang.Object

Class TreeNode implements nodes for class Tree, which implements the arrival tree for air planes. TreeNode determines a node which corresponds a particular Vertex in a graph. Each TreeNode has a parent and two children.

Version:
1
Author:
Potkuri-group

Field Summary
private  TreeNode left
          Left child of a tree node.
private  TreeNode parent
          Parent node of a tree node.
private  TreeNode right
          Right child of a tree node.
private  Vertex vertex
          Vertex this node represents.
 
Constructor Summary
TreeNode(Vertex nodeId)
          Constructor.
 
Method Summary
 TreeNode getLeft()
          Returns this.left.
 TreeNode getParent()
          Returns this.parent.
 TreeNode getRight()
          Returns this.right.
 Vertex getVertex()
          Returns this.vertex.
 boolean setChild(TreeNode child)
          Sets child (left or right, first left) for node.
 void setParent(TreeNode parent)
          Sets this.parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

private TreeNode left
Left child of a tree node.


parent

private TreeNode parent
Parent node of a tree node.


right

private TreeNode right
Right child of a tree node.


vertex

private Vertex vertex
Vertex this node represents.

Constructor Detail

TreeNode

public TreeNode(Vertex nodeId)
Constructor.

Parameters:
nodeId - Vertex this tree node represent.
Method Detail

getLeft

public TreeNode getLeft()
Returns this.left.

Returns:
this.left

getParent

public TreeNode getParent()
Returns this.parent.

Returns:
this.parent

getRight

public TreeNode getRight()
Returns this.right.

Returns:
this.right

getVertex

public Vertex getVertex()
Returns this.vertex.

Returns:
this.vertex

setChild

public boolean setChild(TreeNode child)
Sets child (left or right, first left) for node.

Parameters:
child - Tree node to be set as child.
Returns:
boolean Success.

setParent

public void setParent(TreeNode parent)
Sets this.parent.

Parameters:
parent - Tree node to be set as parent.