|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstatalign.postprocess.plugins.TreeNode
public class TreeNode
Field Summary | |
---|---|
java.util.List<TreeNode> |
children
The children of this node. |
double |
edgeLength
The branch length of this node. |
boolean |
ignoreNode
|
int |
leafCount
The number of leaves in this subtree. |
java.lang.String |
name
The name/identifier of this node. |
int |
nameLengthSum
The sum of the length of the names below this vertex. |
TreeNode |
parent
The parent of this node. |
java.util.HashMap<java.lang.String,java.lang.Object> |
properties
Properties associated with this node. |
Constructor Summary | |
---|---|
TreeNode()
A constructor which does not specify a name nor a edge length. |
|
TreeNode(java.lang.String name)
A constructor specifying the name of the node. |
|
TreeNode(java.lang.String name,
double edgeLength)
A constructor specifying the name and the edge length of the node. |
Method Summary | |
---|---|
void |
addChild(TreeNode node)
Adds a child to this tree's list of children. |
void |
addProperty(java.lang.String key,
java.lang.Object value)
Adds a key=value property to be associated with this node. |
int |
countLeaves()
Calculated the number of leads that exists below this node |
int |
countNameLengthSum()
This function calculates the sum of the length of the strings representing the names of the leaves below this subtree. |
int |
getIntProperty(java.lang.String key)
Same as getProperty(String) but this method returns a value casted to an Integer . |
java.util.List<TreeNode> |
getLeaves()
Finds all of the leaves of the subtree of this node. |
java.util.List<TreeNode> |
getLeaves(TreeNode node)
Same as getLeaves() . |
TreeNode |
getLeft()
TODO: WHAT? |
java.lang.Object |
getProperty(java.lang.String key)
Return the value for a certain key property associated with this node. |
TreeNode |
getRight()
|
boolean |
hasProperty(java.lang.String key)
Determines whether a certain key exists in the properties associated with this node. |
boolean |
isLeaf()
Determines whether this node is a leaf or not. |
double |
maxDepth()
Calculate the maximum depth below on this vertex. |
int |
maxSteps()
Calculate the nodes needed to cross to get to the most distant leaf Used in tree visualisation. |
java.lang.String |
toString()
Constructs a Newick string from this subtree. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String name
public double edgeLength
public java.util.List<TreeNode> children
public TreeNode parent
public java.util.HashMap<java.lang.String,java.lang.Object> properties
public boolean ignoreNode
public int nameLengthSum
public int leafCount
Constructor Detail |
---|
public TreeNode()
public TreeNode(java.lang.String name)
name
- the name of the node.public TreeNode(java.lang.String name, double edgeLength)
name
- the name of the node.edgeLength
- the edge length of the node.Method Detail |
---|
public boolean isLeaf()
public void addChild(TreeNode node)
node
- the child to be added.public java.util.List<TreeNode> getLeaves()
public java.util.List<TreeNode> getLeaves(TreeNode node)
getLeaves()
.
node
- the node that we want to determine the leaves of.
public java.lang.String toString()
toString
in class java.lang.Object
public void addProperty(java.lang.String key, java.lang.Object value)
key
- the key portion of the property.value
- the value portion of the property.public java.lang.Object getProperty(java.lang.String key)
key
- the key portion of the property.
public int getIntProperty(java.lang.String key)
getProperty(String)
but this method returns a value casted to an Integer
.
key
- the key portion of the property.
Integer
).public boolean hasProperty(java.lang.String key)
key
- the key of the property.
public int maxSteps()
public int countNameLengthSum()
public int countLeaves()
public double maxDepth()
public TreeNode getLeft()
public TreeNode getRight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |