org.biojavax.bio.phylo.tree
Class DefaultRootedTreeNode

java.lang.Object
  extended by org.biojavax.bio.phylo.tree.DefaultRootedTreeNode
All Implemented Interfaces:
Node, RootedTreeNode

public class DefaultRootedTreeNode
extends Object
implements RootedTreeNode

Version:
$Id: DefaultRootedTreeNode.java,v 1.2 2006/12/13 17:46:21 tobias Exp $

created on 12.12.2006 15:13:22

Author:
Tobias Thierer

Constructor Summary
DefaultRootedTreeNode()
           
 
Method Summary
 void addBranch(Branch branch)
           
 void addChild(Node node)
          Calls addBranch(new SimpleBranch(this, node)).
 Collection getBranches()
          If this is a RootedTreeNode, then this Collection's iterator is guaranteed to return the parent node first (if there is one).
 Collection getChildren()
           
 RootedTreeNode getParent()
           
 Branch getParentBranch()
           
 int getSubtreeSize()
           
 boolean isLeaf()
           
 void setParentBranch(Branch parentBranch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRootedTreeNode

public DefaultRootedTreeNode()
Method Detail

addChild

public void addChild(Node node)
Calls addBranch(new SimpleBranch(this, node)).

Specified by:
addChild in interface RootedTreeNode
Parameters:
node - New child node to add

getChildren

public Collection getChildren()
Specified by:
getChildren in interface RootedTreeNode

getParent

public RootedTreeNode getParent()
Specified by:
getParent in interface RootedTreeNode

getSubtreeSize

public int getSubtreeSize()
Specified by:
getSubtreeSize in interface RootedTreeNode

setParentBranch

public void setParentBranch(Branch parentBranch)
Specified by:
setParentBranch in interface RootedTreeNode

getParentBranch

public Branch getParentBranch()
Specified by:
getParentBranch in interface RootedTreeNode

addBranch

public void addBranch(Branch branch)
Specified by:
addBranch in interface Node

getBranches

public Collection getBranches()
Description copied from interface: Node
If this is a RootedTreeNode, then this Collection's iterator is guaranteed to return the parent node first (if there is one).

Specified by:
getBranches in interface Node
Returns:
all branches adjacent to this node

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface RootedTreeNode