|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Node
This class keeps track of all the information associated with each node.
Constructor Summary | |
Node(int inCount,
java.lang.String inName,
int inIndex,
double inHeight,
double inLength,
boolean inLive)
Constructs the node object with the specified values. |
|
Node(java.lang.String inName,
int inIndex,
int inNumOfLeaves,
double inLength,
Node inLeftNode,
Node inRightNode,
java.lang.String inSeq)
Constructs the node object with the specified values. |
Method Summary | |
Node |
copy()
Gets a deep copy of a node. |
int |
draw(java.awt.Graphics g,
int unit_x,
int radius,
int rect_width,
int size,
int type)
Defines how to draw a node in distance based algorithms. |
int |
drawMP(java.awt.Graphics g,
int unit_x,
int radius,
int rect_width,
int size)
Defines how to draw a node in the MP algorithms. |
void |
drawMPRight(java.awt.Graphics g,
int unit_x,
int radius,
int rect_width,
int size)
Defines how to draw a node in the last step of the MP algorithm by rotating one rooted tree to the right. |
void |
drawNJRight(java.awt.Graphics g,
int unit_x,
int radius,
int rect_width,
int size,
int type)
Defines how to draw a node in the last step of the FM and NJ algorithms by rotating one rooted tree to the right. |
int |
getBegin_x()
Gets the begin x axis value to draw a node. |
int |
getBegin_y()
Gets the begin y axis value to draw a node. |
int |
getCount()
Gets the number of nodes in a node. |
int |
getEnd_x()
Gets the end x axis value to draw a node. |
int |
getEnd_y()
Gets the end y axis value to draw a node. |
java.lang.String |
getFormattedName()
Gets the name of the node in html formatted style. |
double |
getHeight()
Gets the height of a node. |
int |
getIndex()
Gets the index of a node in the nodes array. |
Node |
getLeftNode()
Gets the left node of a node. |
double |
getLength()
Gets the branch length of a node. |
java.lang.String |
getName()
Gets the name of a node. |
int |
getNumOfLeaves()
Gets the number of leaf nodes rooted at a node. |
double |
getPathLength()
Gets the path length from a node to the leaf node. |
Node |
getRightNode()
Gets the right node of a node. |
java.lang.String |
getSeq()
Gets the character sequence of this node. |
boolean |
isLeaf()
Indicates if a node is a leaf node. |
boolean |
isLive()
Indicates if a node is live. |
void |
kill()
Defines how to kill a node when the node is joined to the other node. |
void |
setBegin_x(int inBegin_x)
Sets the begin x axis value to draw a node. |
void |
setBegin_y(int inBegin_y)
Sets the begin y axis value to draw a node. |
void |
setEnd_x(int inEnd_x)
Sets the end x axis value to draw a node. |
void |
setEnd_y(int inEnd_y)
Sets the end y axis value to draw a node. |
void |
setLeftNode(Node inLeftNode)
Sets the left node of a node. |
void |
setLength(double inLength)
Sets the branch length of a node. |
void |
setNumOfLeaves(int inNumOfLeaves)
Sets the number of leaves rooted at a node. |
void |
setPathLength(double inPathLength)
Sets the path length of a node to a specified value |
void |
setPosition(int inBegin_x,
int inBegin_y,
int inEnd_x,
int inEnd_y)
Sets a node drawing postion form ( begin_x , begin_y ) to (end_x , end_y ). |
void |
setRightNode(Node inRightNode)
Sets the right node of a node. |
void |
setSeq(java.lang.String inSeq)
Sets the character sequence of a node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Node(int inCount, java.lang.String inName, int inIndex, double inHeight, double inLength, boolean inLive)
inCount
- the number of the nodes in the composite nodeinName
- the name of the nodeinIndex
- the index of the node in the nodes arrayinHeight
- the heigth of the nodeinLength
- the branch length of the nodeinLive
- the value indicates if the node is live or deadpublic Node(java.lang.String inName, int inIndex, int inNumOfLeaves, double inLength, Node inLeftNode, Node inRightNode, java.lang.String inSeq)
inName
- the name of the nodeinIndex
- the index of the node in the nodes arrayinNumOfLeaves
- the number of leave nodes rooted at this nodeinLength
- the branch length of the nodeinLeftNode
- the left node of this nodeinRightNode
- the right node of this nodeinSeq
- the character sequence of this nodeMethod Detail |
public java.lang.String getName()
public int getCount()
public double getHeight()
public double getLength()
public double getPathLength()
public int getIndex()
public int getBegin_x()
public int getBegin_y()
public int getEnd_x()
public int getEnd_y()
public Node getLeftNode()
public Node getRightNode()
public int getNumOfLeaves()
public java.lang.String getSeq()
public java.lang.String getFormattedName()
public void setPathLength(double inPathLength)
inPathLength
- the value of the length of the pathpublic void setPosition(int inBegin_x, int inBegin_y, int inEnd_x, int inEnd_y)
begin_x
, begin_y
) to (end_x
, end_y
).
inBegin_x
- the begin x axis valueinBegin_y
- the begin y axis valueinEnd_x
- the end x axis valueinEnd_y
- the end y axis valuepublic void setBegin_x(int inBegin_x)
inBegin_x
- the begin x axis valuepublic void setBegin_y(int inBegin_y)
inBegin_y
- the begin y axis valuepublic void setEnd_x(int inEnd_x)
inEnd_x
- the end x axis valuepublic void setEnd_y(int inEnd_y)
inEnd_y
- the end y axis valuepublic void setLength(double inLength)
inLength
- the value of branch lengthpublic void setLeftNode(Node inLeftNode)
inLeftNode
- the left node of a nodepublic void setRightNode(Node inRightNode)
inRightNode
- the right node of a nodepublic void setNumOfLeaves(int inNumOfLeaves)
inNumOfLeaves
- the number of leavespublic void setSeq(java.lang.String inSeq)
inSeq
- the character sequencepublic void kill()
public boolean isLive()
public boolean isLeaf()
public Node copy()
public int draw(java.awt.Graphics g, int unit_x, int radius, int rect_width, int size, int type)
g
- the Graphics object to draw a nodeunit_x
- the x axis scaling factorradius
- the radius of the circle representing an interior noderect_width
- the width of the rectangle representing a leaf nodesize
- the font sizetype
- the type of a node (either the left node or the rigth node)
public void drawNJRight(java.awt.Graphics g, int unit_x, int radius, int rect_width, int size, int type)
g
- the Graphics object to draw a nodeunit_x
- the x axis scaling factorradius
- the radius of the circle representing an interior noderect_width
- the width of the rectangle representing a leaf nodesize
- the font sizetype
- the type of a node (either the left node or the rigth node)
public int drawMP(java.awt.Graphics g, int unit_x, int radius, int rect_width, int size)
g
- the Graphics object to draw a nodeunit_x
- the x axis scaling factorradius
- the radius of the circle representing an interior noderect_width
- the width of the rectangle representing a leaf nodesize
- the font size
public void drawMPRight(java.awt.Graphics g, int unit_x, int radius, int rect_width, int size)
g
- the Graphics object to draw a nodeunit_x
- the x axis scaling factorradius
- the radius of the circle representing an interior noderect_width
- the width of the rectangle representing a leaf nodesize
- the font size
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |