Package pal.tree

Interface Tree

All Superinterfaces:
IdGroup, Serializable, Units, UnitsProvider
All Known Subinterfaces:
ParameterizedTree
All Known Implementing Classes:
ClockTree, ClusterTree, DemographicClockTree, LogParameterizedTree, MutationRateModelTree, NeighborJoiningTree, ParameterizedTree.ParameterizedTreeBase, ReadTree, SimpleTree, SUPGMATree, Tree.TreeBase, UnconstrainedTree, UPGMATree

public interface Tree extends IdGroup, Units, Serializable, UnitsProvider
Interface for a phylogenetic or genealogical tree.
Version:
$Id: Tree.java,v 1.22 2002/10/03 06:06:55 matt Exp $
Author:
Alexei Drummond
  • Method Details

    • getRoot

      Node getRoot()
      Returns:
      the root node of this tree.
    • setRoot

      void setRoot(Node root)
      This method constructs a tree from the given root node.
      Parameters:
      root - the root node of the tree to construct.
    • getExternalNodeCount

      int getExternalNodeCount()
      Returns:
      a count of the number of external nodes (tips) in this tree.
    • getInternalNodeCount

      int getInternalNodeCount()
      Returns:
      a count of the number of internal nodes (and hence clades) in this tree.
    • getExternalNode

      Node getExternalNode(int i)
      Returns:
      the ith external node in the tree.
    • getInternalNode

      Node getInternalNode(int i)
      Returns:
      the ith internal node in the tree.
    • createNodeList

      void createNodeList()
      This method is called to ensure that the calls to other methods in this interface are valid.
    • getUnits

      int getUnits()
      Gets the units that this tree's branch lengths and node heights are expressed in.
      Specified by:
      getUnits in interface UnitsProvider
      Returns:
      the units relating to this object.
    • setAttribute

      void setAttribute(Node node, String name, Object value)
      Sets an named attribute for a given node.
      Parameters:
      node - the node whose attribute is being set.
      name - the name of the attribute.
      value - the new value of the attribute.
    • getAttribute

      Object getAttribute(Node node, String name)
      Parameters:
      node - the node being interrogated.
      name - the name of the attribute of interest.
      Returns:
      an object representing the named attributed for the numbered node.
    • getCopy

      Tree getCopy()
      Returns:
      a clone of this tree