|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.data.MSTNode
public class MSTNode
A class that represents a single node in a Minimum Spanning Tree (MST). This class is a pure data class that is used to encapsulate the information pertaining to a node on a Minimum Spanning Tree (MST). This class is a self-referential structure, in that the child nodes of this class are MSTNode objects. This definition permits a MSTNode to contain a complete sub-tree as a part of it. The MSTNode objects are created and used by the MST class that represents the top-level MST.
Field Summary | |
---|---|
(package private) int |
alignmentMetric
The alignment metric generated by a given EST analyzer indicating some of the alignment relationship between this node and its parent node. |
private java.util.ArrayList<MSTNode> |
childNodes
This array list contains the list of child nodes for this node. |
(package private) int |
estIdx
The zero-based index of the EST that a given MST node represents. |
(package private) float |
metric
The similarity/distance metric generated by a given EST analyzer indicating the relationship between this node and its parent node. |
private MSTNode |
parent
The parent node for this MSTNode. |
Constructor Summary | |
---|---|
MSTNode(MSTNode parent,
int estIndex,
float nodeMetric,
int alignment)
Constructor to create a MSTNode. |
Method Summary | |
---|---|
void |
addChild(MSTNode node)
Add another MSTNode as the child node of this node. |
int |
getAlignmentMetric()
Returns the distance metric value set for this node. |
java.util.ArrayList<MSTNode> |
getChildren()
Obtain the child nodes for this node. |
int |
getESTIndex()
Obtain the index of the EST associated with this node. |
float |
getMetric()
Returns the metric value set for this node. |
boolean |
isLeaf()
Determine if this node is a leaf node that has no child nodes. |
boolean |
isRoot()
Determine if this node is the root node. |
void |
print(java.io.PrintStream out,
MSTNode node,
java.lang.String indent)
Method to recursively print the information that is stored in this node. |
java.lang.String |
toString()
This method returns the EST index and metric as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private MSTNode parent
private java.util.ArrayList<MSTNode> childNodes
int estIdx
float metric
int alignmentMetric
Constructor Detail |
---|
public MSTNode(MSTNode parent, int estIndex, float nodeMetric, int alignment)
parent
- The parent node for this MST. If this node is the root
node in the MST, then this parameter can be null.estIndex
- The index of the EST. This value must be the index
of the corresponding EST in the list of ESTs in the ESTList
associated with the MST in which this node is present.nodeMetric
- The similarity/distance metric between this EST and
its parent EST.alignment
- The alignment metric generated by a given EST analyzer
indicating some of the alignment relationship between this node and its
parent node.Method Detail |
---|
public void addChild(MSTNode node)
node
- The node to be added as a direct child of this node.public boolean isRoot()
Note: This method is meaningful only after a complete MST has been built.
public boolean isLeaf()
Note: This method is meaningful only after a complete MST has been built.
public float getMetric()
public int getAlignmentMetric()
public int getESTIndex()
public java.lang.String toString()
toString
in class java.lang.Object
public void print(java.io.PrintStream out, MSTNode node, java.lang.String indent)
out
- The output stream to which the data is to be serialized.node
- The node toindent
- The number of spaces to be used to indent the output.public java.util.ArrayList<MSTNode> getChildren()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |