pal.tree
Class ParameterizedTree.ParameterizedTreeBase

java.lang.Object
  extended by pal.tree.ParameterizedTree.ParameterizedTreeBase
All Implemented Interfaces:
java.io.Serializable, IdGroup, Parameterized, Units, UnitsProvider, Tree
Direct Known Subclasses:
ClockTree, LogParameterizedTree, MutationRateModelTree, UnconstrainedTree
Enclosing interface:
ParameterizedTree

public abstract static class ParameterizedTree.ParameterizedTreeBase
extends java.lang.Object
implements Parameterized, Tree

For parameterisations that work by adjusting a base tree (that is, they aren't really tree's themselves...)

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface pal.misc.Parameterized
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser, Parameterized.Utils
 
Nested classes/interfaces inherited from interface pal.tree.Tree
Tree.TreeBase
 
Field Summary
 
Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, SAMPLE, SHORT_UNIT_NAMES, UNIT_NAMES, UNKNOWN, YEARS
 
Constructor Summary
  ParameterizedTree.ParameterizedTreeBase()
           
protected ParameterizedTree.ParameterizedTreeBase(ParameterizedTree.ParameterizedTreeBase toCopy)
          Cloning constructor
  ParameterizedTree.ParameterizedTreeBase(Tree baseTree)
           
 
Method Summary
 void createNodeList()
          This method is called to ensure that the calls to other methods in this interface are valid.
 java.lang.Object getAttribute(Node node, java.lang.String name)
           
protected  Tree getBaseTree()
           
 Tree getCopy()
          The cheapy copy that just creates a SimpleTree
 Node getExternalNode(int i)
          returns the ith external node in the tree.
 int getExternalNodeCount()
          returns a count of the number of external nodes (tips) in this tree.
 int getIdCount()
          Returns the number of identifiers in this group
 Identifier getIdentifier(int i)
          Returns the ith identifier.
 Node getInternalNode(int i)
          returns the ith internal node in the tree.
 int getInternalNodeCount()
          returns a count of the number of internal nodes (and hence clades) in this tree.
 int getNodeCount()
           
 OrthogonalHints getOrthogonalHints()
           
 Node getRoot()
          Returns the root node of this tree.
 int getUnits()
          Gets the units that this tree's branch lengths and node heights are expressed in.
 void setAttribute(Node node, java.lang.String name, java.lang.Object value)
          Sets an named attribute for a given node.
protected  void setBaseTree(Tree baseTree)
           
 void setIdentifier(int i, Identifier id)
          Sets the ith identifier.
 void setRoot(Node root)
          This method constructs a tree from the given root node.
 java.lang.String toString()
           
 int whichIdNumber(java.lang.String s)
          returns the index of the identifier with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface pal.misc.Parameterized
getDefaultValue, getLowerLimit, getNumParameters, getParameter, getUpperLimit, setParameter, setParameterSE
 

Constructor Detail

ParameterizedTree.ParameterizedTreeBase

protected ParameterizedTree.ParameterizedTreeBase(ParameterizedTree.ParameterizedTreeBase toCopy)
Cloning constructor


ParameterizedTree.ParameterizedTreeBase

public ParameterizedTree.ParameterizedTreeBase()

ParameterizedTree.ParameterizedTreeBase

public ParameterizedTree.ParameterizedTreeBase(Tree baseTree)
Method Detail

setBaseTree

protected void setBaseTree(Tree baseTree)

getBaseTree

protected Tree getBaseTree()

getRoot

public final Node getRoot()
Returns the root node of this tree.

Specified by:
getRoot in interface Tree
Returns:
the root node of this tree.

setRoot

public final void setRoot(Node root)
Description copied from interface: Tree
This method constructs a tree from the given root node.

Specified by:
setRoot in interface Tree
Parameters:
root - the root node of the tree to construct.

getIdentifier

public final Identifier getIdentifier(int i)
Description copied from interface: IdGroup
Returns the ith identifier.

Specified by:
getIdentifier in interface IdGroup

setIdentifier

public final void setIdentifier(int i,
                                Identifier id)
Description copied from interface: IdGroup
Sets the ith identifier.

Specified by:
setIdentifier in interface IdGroup

getIdCount

public final int getIdCount()
Description copied from interface: IdGroup
Returns the number of identifiers in this group

Specified by:
getIdCount in interface IdGroup

whichIdNumber

public final int whichIdNumber(java.lang.String s)
Description copied from interface: IdGroup
returns the index of the identifier with the given name.

Specified by:
whichIdNumber in interface IdGroup

getExternalNodeCount

public final int getExternalNodeCount()
returns a count of the number of external nodes (tips) in this tree.

Specified by:
getExternalNodeCount in interface Tree
Returns:
a count of the number of external nodes (tips) in this tree.

getInternalNodeCount

public final int getInternalNodeCount()
returns a count of the number of internal nodes (and hence clades) in this tree.

Specified by:
getInternalNodeCount in interface Tree
Returns:
a count of the number of internal nodes (and hence clades) in this tree.

getNodeCount

public final int getNodeCount()

getExternalNode

public final Node getExternalNode(int i)
returns the ith external node in the tree.

Specified by:
getExternalNode in interface Tree
Returns:
the ith external node in the tree.

getInternalNode

public final Node getInternalNode(int i)
returns the ith internal node in the tree.

Specified by:
getInternalNode in interface Tree
Returns:
the ith internal node in the tree.

createNodeList

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

Specified by:
createNodeList in interface Tree

getUnits

public final int getUnits()
Description copied from interface: Tree
Gets the units that this tree's branch lengths and node heights are expressed in.

Specified by:
getUnits in interface UnitsProvider
Specified by:
getUnits in interface Tree
Returns:
the units relating to this object.

setAttribute

public final void setAttribute(Node node,
                               java.lang.String name,
                               java.lang.Object value)
Description copied from interface: Tree
Sets an named attribute for a given node.

Specified by:
setAttribute in interface Tree
Parameters:
node - the node whose attribute is being set.
name - the name of the attribute.
value - the new value of the attribute.

getAttribute

public final java.lang.Object getAttribute(Node node,
                                           java.lang.String name)
Specified by:
getAttribute in interface Tree
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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCopy

public Tree getCopy()
The cheapy copy that just creates a SimpleTree

Specified by:
getCopy in interface Tree
Returns:
a clone of this tree

getOrthogonalHints

public OrthogonalHints getOrthogonalHints()
Returns:
null by default (implying not hint information)