Package pal.tree
Interface Node
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
AttributeNode
- All Known Implementing Classes:
PositionedNode,SimpleNode
public interface Node extends java.io.Serializableinterface for a node (includes branch) in a binary/non-binary rooted/unrooted tree- Version:
- $Id: Node.java,v 1.23 2002/09/08 03:43:04 matt Exp $
- Author:
- Alexei Drummond, Korbinian Strimmer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddChild(Node c)add new child nodedoublegetBranchLength()Get the length of the branch attaching this node to its parent.doublegetBranchLengthSE()Get the length SE of the branch attaching this node to its parent.NodegetChild(int n)get child nodeintgetChildCount()Returns the number of children this node has.IdentifiergetIdentifier()Returns the identifier for this node.doublegetNodeHeight()Get the height of this node relative to the most recent node.intgetNumber()return the index of this nodeNodegetParent()Returns the parent node of this node.byte[]getSequence()Returns the sequence at this node, in the form an array of bytes.voidinsertChild(Node c, int pos)add new child node (insertion at a specific position)booleanisLeaf()check whether this node is an external nodebooleanisRoot()check whether this node is a root nodeNoderemoveChild(int n)remove childvoidsetBranchLength(double value)Set the length of the branch attaching this node to its parent.voidsetBranchLengthSE(double value)Set the length SE of the branch attaching this node to its parent.voidsetChild(int n, Node node)set child nodevoidsetIdentifier(Identifier id)Set identifier for this node.voidsetNodeHeight(double value)Set the height of this node relative to the most recent node.voidsetNodeHeight(double value, boolean adjustChildBranchLengths)Set the height of this node relative to the most recent node.voidsetNumber(int number)set the index of this nodevoidsetParent(Node node)Set the parent node of this node.voidsetSequence(byte[] array)Sets the sequence using an array of bytes.
-
-
-
Method Detail
-
getParent
Node getParent()
Returns the parent node of this node.
-
setParent
void setParent(Node node)
Set the parent node of this node.
-
getSequence
byte[] getSequence()
Returns the sequence at this node, in the form an array of bytes.
-
setSequence
void setSequence(byte[] array)
Sets the sequence using an array of bytes.
-
getNumber
int getNumber()
return the index of this node
-
setNumber
void setNumber(int number)
set the index of this node
-
getBranchLength
double getBranchLength()
Get the length of the branch attaching this node to its parent.
-
setBranchLength
void setBranchLength(double value)
Set the length of the branch attaching this node to its parent.
-
getBranchLengthSE
double getBranchLengthSE()
Get the length SE of the branch attaching this node to its parent.
-
setBranchLengthSE
void setBranchLengthSE(double value)
Set the length SE of the branch attaching this node to its parent.
-
getNodeHeight
double getNodeHeight()
Get the height of this node relative to the most recent node.
-
setNodeHeight
void setNodeHeight(double value)
Set the height of this node relative to the most recent node.
-
setNodeHeight
void setNodeHeight(double value, boolean adjustChildBranchLengths)Set the height of this node relative to the most recent node.- Parameters:
adjustChildBranchLengths- if true
-
getIdentifier
Identifier getIdentifier()
Returns the identifier for this node.
-
setIdentifier
void setIdentifier(Identifier id)
Set identifier for this node.
-
getChildCount
int getChildCount()
Returns the number of children this node has.
-
isLeaf
boolean isLeaf()
check whether this node is an external node- Returns:
- result (true or false)
-
isRoot
boolean isRoot()
check whether this node is a root node- Returns:
- result (true or false)
-
getChild
Node getChild(int n)
get child node- Parameters:
n- number of child- Returns:
- child node
-
setChild
void setChild(int n, Node node)set child node- Parameters:
n- number
-
addChild
void addChild(Node c)
add new child node- Parameters:
c- new child node
-
insertChild
void insertChild(Node c, int pos)
add new child node (insertion at a specific position)- Parameters:
c- new child node + @param pos position
-
removeChild
Node removeChild(int n)
remove child- Parameters:
n- number of child to be removed
-
-