jebl.evolution.trees
Interface Tree

All Superinterfaces:
Attributable, Graph
All Known Subinterfaces:
RootedTree
All Known Implementing Classes:
CompactRootedTree, FilteredRootedTree, MutableRootedTree, ReRootedTree, RootedFromUnrooted, RootedSubtree, SimpleRootedTree, SimpleTree, SortedRootedTree, TransformedRootedTree

public interface Tree
extends Graph

A rooted or unrooted tree. This interface is the common base class for all trees, and contains only operations for unrooted trees. The subinterface RootedTree contains additional methods that make sense only on rooted trees. Both interfaces contain no mutator methods. As of 2006-12-08, the only way to mutate a tree after it has been built is to use its concrete class instead of the Tree or RootedTree interface.

Version:
$Id: Tree.java 627 2007-01-15 03:50:40Z pepster $
Author:
rambaut, Alexei Drummond

Nested Class Summary
 
Nested classes/interfaces inherited from interface jebl.evolution.graphs.Graph
Graph.NoEdgeException, Graph.Utils
 
Method Summary
 java.util.Set<Edge> getExternalEdges()
           
 java.util.Set<Node> getExternalNodes()
           
 java.util.Set<Edge> getInternalEdges()
           
 java.util.Set<Node> getInternalNodes()
           
 Node getNode(Taxon taxon)
           
 java.util.Set<Taxon> getTaxa()
           
 Taxon getTaxon(Node node)
           
 boolean isExternal(Node node)
           
 void renameTaxa(Taxon from, Taxon to)
           
 
Methods inherited from interface jebl.evolution.graphs.Graph
getAdjacencies, getEdge, getEdgeLength, getEdges, getEdges, getNodes, getNodes, getNodes
 
Methods inherited from interface jebl.util.Attributable
getAttribute, getAttributeMap, getAttributeNames, removeAttribute, setAttribute
 

Method Detail

getExternalNodes

java.util.Set<Node> getExternalNodes()
Returns:
a set of all nodes that have degree 1. These nodes are often refered to as 'tips'.

getInternalNodes

java.util.Set<Node> getInternalNodes()
Returns:
a set of all nodes that have degree 2 or more. These nodes are often refered to as internal nodes.

getExternalEdges

java.util.Set<Edge> getExternalEdges()
Returns:
a set of all edges that have a degree 1 node.

getInternalEdges

java.util.Set<Edge> getInternalEdges()
Returns:
a set of all edges for which both nodes have degree 2 or more.

getTaxa

java.util.Set<Taxon> getTaxa()
Returns:
the set of taxa associated with the external nodes of this tree. The size of this set should be the same as the size of the external nodes set.

getTaxon

Taxon getTaxon(Node node)
Parameters:
node - the node whose associated taxon is being requested.
Returns:
the taxon object associated with the given node, or null if the node is an internal node.

isExternal

boolean isExternal(Node node)
Parameters:
node - the node
Returns:
true if the node is of degree 1.

getNode

Node getNode(Taxon taxon)
Parameters:
taxon - the taxon
Returns:
the external node associated with the given taxon, or null if the taxon is not a member of the taxa set associated with this tree.

renameTaxa

void renameTaxa(Taxon from,
                Taxon to)


http://code.google.com/p/jebl2/