public class SimpleTree implements Tree
data structure for a binary/non-binary rooted/unrooted trees
public SimpleTree()
constructor tree consisting solely of root node
public SimpleTree(Node r)
constructor taking a root node
public SimpleTree(Tree tree)
clone constructor
public SimpleTree(Tree tree, boolean keepIdentifiers)
clone constructor
public SimpleTree(Tree tree, LabelMapping lm)
clone constructor
lm - - a label mapping use for translating the original label names into something elsepublic int getUnits()
Return the units that this tree is expressed in.
public void setUnits(int units)
Sets the units that this tree is expressed in.
public int getExternalNodeCount()
Returns the number of external nodes.
public Node getExternalNode(int i)
Returns the ith external node.
public int getInternalNodeCount()
Returns the number of internal nodes.
public Node getInternalNode(int i)
Returns the ith internal node.
public Node getRoot()
Returns the root node of this tree.
public void setRoot(Node r)
Set a new node as root node.
public void createNodeList()
count and list external and internal nodes and compute heights of each node
public java.lang.String toString()
public Node findNode(int num)
return node with number num (as displayed in ASCII tree)
num - number of nodepublic void setAttribute(Node node, java.lang.String name, java.lang.Object value)
Sets an named attribute for a given node.
node - the node whose attribute is being set.name - the name of the attribute.value - the new value of the attribute.public int whichIdNumber(Taxon t)
public java.lang.Object getAttribute(Node node, java.lang.String name)
node - the node being interrogated.name - the name of the attribute of interest.public void reroot(int num)
make node with number num to root node
num - number of nodepublic void reroot(Node node)
make provided node the root node
node - the node to make the root.public void report(java.io.Writer out)
public Tree getCopy()