PolyLine
Class RealizerNode

java.lang.Object
  extended by PolyLine.RealizerNode

public class RealizerNode
extends java.lang.Object

A class representing each node in the realizer.

Represents a node of the realizer, which is a vertex of a graph.

Copyright: Copyright (c) 2008

Company: Bangladesh University of engineering and technology


Field Summary
(package private)  int[] childMax
          The id of the child having maximum layer value
(package private)  java.util.LinkedList<java.lang.Integer> childT0List
          Linked list of the id of the child of this node in Tree_0
(package private)  int id
          Identity value of the node
(package private)  boolean isLeafT0
          if true then this node is a leaf in Tree_0 else not
(package private)  int layer
          Layer value of this node
(package private)  int[] parent
          array of the id's of the its parent of this node.
(package private)  int x
          Abscissa or x-coodinate value of this node
(package private)  int xL
          id of the node which is left most leaf in the subtree who have this node as root
(package private)  int xR
          id of the node which is right most leaf in the subtree who have this node as root
 
Constructor Summary
RealizerNode(int id)
          Constructor of the node .
 
Method Summary
 void addChildT0(int id)
          Adds the id into the linked list childT0List
(package private)  int getChildMax(int treeId)
          Returns the maximum layer node of this node in tree treeId
 int getChildT0()
          Returns the top id in the list but doesn't remove from the list
 int getId()
          Returns id of this node
(package private)  int getLayer()
          Returns the layer value of this node
(package private)  int getParent(int treeId)
          Returns the parent of this node in tree treeId
 int getX()
          Returns Abscissa of this node
 int getXL()
          Returns the id of the left most leaf id of its subtree.
 int getXR()
          Returns the id of the right most leaf id of its subtree.
 boolean isLeafT0()
          Return whether this node is leaf of tree_0
 boolean isRoot(int treeId)
          Checks whether this node is the root of any particular tree.
 int popChildT0()
          Returns the top id in the list and removes from the list
(package private)  void setChildMax(int nodeId, int treeId)
          Sets nodeId as its the maximum layer node in tree_treeId of this node
(package private)  void setLayer(int value)
          Sets this.layer to the value .
 void setLeafT0()
          Sets that this node is a leaf of Tree_0
(package private)  void setParent(int nodeId, int treeId)
          Sets nodeId as parent in tree_treeId of this node
(package private)  void setX(int value)
          Sets the abscissa of this node
 void setXL(int val)
          Sets this.xL= val
 void setXR(int val)
          Sets this.xR= val
 java.lang.String toString()
          Returns the string value of the object
Format: id childTo childMax in Tree 0,1,2 layer x xL xR isLeaf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

int id
Identity value of the node


parent

int[] parent
array of the id's of the its parent of this node.
parent[0] -> parent of this node in Tree_0
parent[1] -> parent of this node in Tree_1
parent[2] -> parent of this node in Tree_2


childMax

int[] childMax

The id of the child having maximum layer value

childMax[0]-> id of the child of this node having maximum layer in Tree_0
childMax[1]-> id of the child of this node having maximum layer in Tree_1
childMax[2]-> id of the child of this node having maximum layer in Tree_2


layer

int layer
Layer value of this node


x

int x
Abscissa or x-coodinate value of this node


xL

int xL
id of the node which is left most leaf in the subtree who have this node as root


xR

int xR
id of the node which is right most leaf in the subtree who have this node as root


childT0List

java.util.LinkedList<java.lang.Integer> childT0List
Linked list of the id of the child of this node in Tree_0


isLeafT0

boolean isLeafT0
if true then this node is a leaf in Tree_0 else not

Constructor Detail

RealizerNode

public RealizerNode(int id)
Constructor of the node .

Parameters:
id - id value of this node
Method Detail

setXL

public void setXL(int val)
Sets this.xL= val

Parameters:
val - integer value

setXR

public void setXR(int val)
Sets this.xR= val

Parameters:
val - integer value

getXL

public int getXL()
Returns the id of the left most leaf id of its subtree.

Returns:
the left most leaf id of its subtree.

getXR

public int getXR()
Returns the id of the right most leaf id of its subtree.

Returns:
the right most leaf id of its subtree.

getX

public int getX()
Returns Abscissa of this node

Returns:
abscissa of this node

getId

public int getId()
Returns id of this node

Returns:
id of this node

isRoot

public boolean isRoot(int treeId)
Checks whether this node is the root of any particular tree.

Parameters:
treeId - integer value in ={0,1,2}
Returns:
if true then this node is the root of the tree of treeId

addChildT0

public void addChildT0(int id)
Adds the id into the linked list childT0List

Parameters:
id - the id of any node to be added to the list

getChildT0

public int getChildT0()
Returns the top id in the list but doesn't remove from the list

Returns:
id of the node which is in childToList

popChildT0

public int popChildT0()
Returns the top id in the list and removes from the list

Returns:
id of the node which is in childToList

setLeafT0

public void setLeafT0()
Sets that this node is a leaf of Tree_0


isLeafT0

public boolean isLeafT0()
Return whether this node is leaf of tree_0

Returns:
if true then this node is leaf of tree_0.

setChildMax

void setChildMax(int nodeId,
                 int treeId)
Sets nodeId as its the maximum layer node in tree_treeId of this node

Parameters:
nodeId - id value of any node
treeId - value in ={0,1,2}

setParent

void setParent(int nodeId,
               int treeId)
Sets nodeId as parent in tree_treeId of this node

Parameters:
nodeId - id value of any node
treeId - value in ={0,1,2}

getParent

int getParent(int treeId)
Returns the parent of this node in tree treeId

Parameters:
treeId - the id of the tree who's parent in the tree.
Returns:
Integer value , the id the parent in the tree_treeId.

getChildMax

int getChildMax(int treeId)
Returns the maximum layer node of this node in tree treeId

Parameters:
treeId - the id of the tree who's child in the tree.
Returns:
Integer

setLayer

void setLayer(int value)
Sets this.layer to the value .

Parameters:
value - integer value of the node id.

getLayer

int getLayer()
Returns the layer value of this node

Returns:
Integer value of the layer of the node.

setX

void setX(int value)
Sets the abscissa of this node

Parameters:
value - integer value to be set as the abscissa

toString

public java.lang.String toString()
Returns the string value of the object
Format: id childTo childMax in Tree 0,1,2 layer x xL xR isLeaf

Overrides:
toString in class java.lang.Object
Returns:
String value