|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpal.tree.SimpleNode
public class SimpleNode
data structure for a node (includes branch) in a binary/non-binary rooted/unrooted tree
| Field Summary |
|---|
| Fields inherited from interface pal.tree.AttributeNode |
|---|
CLADE_PROBABILITY, MEAN_CLADE_HEIGHT, NODE_HEIGHT_SE, SUBTREE_PROBABILITY |
| Constructor Summary | |
|---|---|
|
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)
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
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()
getParent in interface Nodepublic void setParent(Node node)
setParent in interface Nodepublic 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 Node
public 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)
Node
setNumber in interface Nodepublic int getNumber()
Node
getNumber in interface Nodepublic Node getChild(int n)
getChild in interface Noden - number of child
public void setChild(int n,
Node node)
setChild in interface Noden - numberpublic boolean hasChildren()
public boolean isLeaf()
isLeaf in interface Nodepublic boolean isRoot()
isRoot in interface Nodepublic void addChild(Node n)
addChild in interface Noden - new child node
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||