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
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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface pal.misc.IdGroup
IdGroup.Utils
-
Field Summary
Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, SAMPLE, SHORT_UNIT_NAMES, UNIT_NAMES, UNKNOWN, YEARS
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called to ensure that the calls to other methods in this interface are valid.getAttribute
(Node node, String name) getCopy()
getExternalNode
(int i) int
getInternalNode
(int i) int
getRoot()
int
getUnits()
Gets the units that this tree's branch lengths and node heights are expressed in.void
setAttribute
(Node node, String name, Object value) Sets an named attribute for a given node.void
This method constructs a tree from the given root node.Methods inherited from interface pal.misc.IdGroup
getIdCount, getIdentifier, setIdentifier, whichIdNumber
-
Method Details
-
getRoot
Node getRoot()- Returns:
- the root node of this tree.
-
setRoot
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
- Returns:
- the ith external node in the tree.
-
getInternalNode
- 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 interfaceUnitsProvider
- Returns:
- the units relating to this object.
-
setAttribute
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
- 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
-