Constructor and Description |
---|
PhyloNode()
Basic constructor
|
PhyloNode(StringBuffer xml)
The standard constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
void |
addChild(PhyloNode node)
This method adds a children node to the current instance
|
PhyloNode |
clone() |
ArrayList<PhyloNode> |
getAllLeafs()
This method returns a list of
PhyloNode s that are leafs in the subtree starting from this instance |
ArrayList<PhyloNode> |
getChildrenNodes()
This method returns a list of
PhyloNode s that are children of this instance |
int |
getId()
This method returns the ID of the current PhyloNode
|
String |
getName()
This method returns the name of the current instance
|
int |
getNumberOfAllNodesBelow()
This method returns the total number of
PhyloNode s in the subtree starting from this instance |
double |
getWeight()
This method return the weight (length, rate ...) for the incoming edge
|
void |
setId(int id)
This method set the ID of the current PhyloNode
The ID should be unique in the PhyloTree
|
void |
setName(String name)
This method set a name for the current instance
|
void |
setWeight(double w)
This method set the weight (length, rate ...) for the incoming edge
|
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public PhyloNode()
public PhyloNode(StringBuffer xml) throws NonParsableException
Storable
.
Constructs a PhyloNode
out of an XML representation.xml
- the XML representation as StringBuffer
NonParsableException
- if the PhyloNode
could not be reconstructed out of
the StringBuffer
xml
public PhyloNode clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void addChild(PhyloNode node)
node
- the children nodepublic void setName(String name)
name
- the name of the PhyloNodepublic String getName()
public void setId(int id)
id
- the ID of the nodepublic int getId()
public void setWeight(double w)
w
- the weightpublic double getWeight()
public int getNumberOfAllNodesBelow()
PhyloNode
s in the subtree starting from this instancepublic ArrayList<PhyloNode> getChildrenNodes()
PhyloNode
s that are children of this instancepublic ArrayList<PhyloNode> getAllLeafs()
PhyloNode
s that are leafs in the subtree starting from this instancepublic StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.