public class SimpleNode extends java.lang.Object implements AttributeNode
CLADE_PROBABILITY, MEAN_CLADE_HEIGHT, NODE_HEIGHT_SE, SUBTREE_PROBABILITY| Modifier | Constructor and Description |
|---|---|
|
SimpleNode()
constructor default node
|
|
SimpleNode(Node n)
constructor used to clone a node and all children
|
protected |
SimpleNode(Node[] children) |
protected |
SimpleNode(Node[] children,
double branchLength)
Constructor
|
|
SimpleNode(Node n,
boolean keepIds) |
|
SimpleNode(Node n,
LabelMapping lm) |
|
SimpleNode(java.lang.String name,
double branchLength) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Node n)
add new child node
|
java.lang.Object |
getAttribute(java.lang.String name) |
java.util.Enumeration |
getAttributeNames() |
double |
getBranchLength()
Get the length of the branch attaching this node to its parent.
|
double |
getBranchLengthSE()
Get the length SE of the branch attaching this node to its parent.
|
Node |
getChild(int n)
get child node
|
int |
getChildCount()
Returns the number of children this node has.
|
Identifier |
getIdentifier()
Returns the identifier for this node.
|
double |
getNodeHeight()
Get the height of this node relative to the most recent node.
|
int |
getNumber()
return the index of this node
|
Node |
getParent()
Returns the parent node of this node.
|
byte[] |
getSequence()
Returns the sequence at this node, in the form of an array of bytes.
|
java.lang.String |
getSequenceString()
Returns the sequence at this node, in the form of a String.
|
boolean |
hasChildren()
check whether this node is an internal node
|
protected void |
init(Node n) |
protected void |
init(Node n,
boolean keepId)
Initialized node instance variables based on given Node.
|
protected void |
init(Node n,
boolean keepId,
LabelMapping lm)
Initialized node instance variables based on given Node.
|
void |
insertChild(Node n,
int pos)
add new child node (insertion at a specific position)
|
boolean |
isLeaf()
check whether this node is an external node
|
boolean |
isRoot()
check whether this node is a root node
|
void |
lengths2HeightsContemp()
determines the height of this node and its descendants
from branch lengths, assuming contemporaneous tips.
|
Node |
removeChild(int n)
remove child
|
void |
removeParent()
removes parent.
|
void |
reset() |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a named attribute to the given value.
|
void |
setBranchLength(double value)
Set the length of the branch attaching this node to its parent.
|
void |
setBranchLengthSE(double value)
Set the length SE of the branch attaching this node to its parent.
|
void |
setChild(int n,
Node node)
set child node
|
void |
setIdentifier(Identifier id)
Set identifier for this node.
|
void |
setNodeHeight(double value)
Set the height of this node relative to the most recent node.
|
void |
setNodeHeight(double value,
boolean adjustChildBranchLengths)
Set the height of this node relative to the most recent node.
|
void |
setNumber(int n)
set the index of this node
|
void |
setParent(Node node)
Set the parent node of this node.
|
void |
setSequence(byte[] s)
Sets the sequence at this node, in the form of an array of bytes.
|
java.lang.String |
toString() |
public SimpleNode()
public SimpleNode(java.lang.String name,
double branchLength)
protected SimpleNode(Node[] children, double branchLength)
children - branchLength - java.lang.IllegalArgumentException - if only one child!protected SimpleNode(Node[] children)
public SimpleNode(Node n)
public SimpleNode(Node n, boolean keepIds)
public SimpleNode(Node n, LabelMapping lm)
public void reset()
protected void init(Node n)
protected void init(Node n, boolean keepId)
protected void init(Node n, boolean keepId, LabelMapping lm)
lm - - may be nullpublic final Node getParent()
public void setParent(Node node)
public final void removeParent()
public java.lang.String getSequenceString()
public byte[] getSequence()
getSequence in interface Nodepublic void setSequence(byte[] s)
setSequence in interface Nodepublic final double getBranchLength()
getBranchLength in interface Nodepublic final void setBranchLength(double value)
setBranchLength in interface Nodepublic final double getBranchLengthSE()
getBranchLengthSE in interface Nodepublic final void setBranchLengthSE(double value)
setBranchLengthSE in interface Nodepublic final double getNodeHeight()
getNodeHeight in interface Nodepublic final void setNodeHeight(double value)
setNodeHeight in interface Nodepublic final void setNodeHeight(double value,
boolean adjustChildBranchLengths)
setNodeHeight in interface NodeadjustChildBranchLengths - if truepublic final Identifier getIdentifier()
getIdentifier in interface Nodepublic final void setIdentifier(Identifier id)
setIdentifier in interface Nodepublic void setNumber(int n)
Nodepublic int getNumber()
Nodepublic Node getChild(int n)
public void setChild(int n,
Node node)
public boolean hasChildren()
public boolean isLeaf()
public boolean isRoot()
public void addChild(Node n)
public void insertChild(Node n, int pos)
insertChild in interface Noden - new child node
+ @param pos positionpublic Node removeChild(int n)
removeChild in interface Noden - number of child to be removedpublic void lengths2HeightsContemp()
public final void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface AttributeNodename - the name of the attributevalue - the value to set the attributepublic final java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface AttributeNodename - the name of the attribute.public final java.util.Enumeration getAttributeNames()
getAttributeNames in interface AttributeNodepublic final int getChildCount()
getChildCount in interface Nodepublic java.lang.String toString()
toString in class java.lang.Object