|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpal.tree.Tree.TreeBase
public abstract static class Tree.TreeBase
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface pal.tree.Tree |
|---|
Tree.TreeBase |
| Nested 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 |
| Constructor Summary | |
|---|---|
protected |
Tree.TreeBase()
constructor |
protected |
Tree.TreeBase(Node theRoot)
constructor |
protected |
Tree.TreeBase(Tree.TreeBase tree,
Node newRoot)
clone constructor |
| Method Summary | |
|---|---|
void |
createNodeList()
count and list external and internal nodes and compute heights of each node |
Node |
findNode(int num)
return node with number num (as displayed in ASCII tree) |
java.lang.Object |
getAttribute(Node node,
java.lang.String name)
|
Node |
getExternalNode(int i)
Returns the ith external node. |
int |
getExternalNodeCount()
Returns the number of external nodes. |
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. |
int |
getInternalNodeCount()
Returns the number of internal nodes. |
Node |
getRoot()
Returns the root node of this tree. |
int |
getUnits()
Return the units that this tree is expressed in. |
void |
report(java.io.PrintWriter out)
print human readable report (e.g., on parameters and associated model) |
void |
reroot(int num)
make node with number num to root node |
void |
reroot(Node node)
make provided node the root node |
void |
setAttribute(Node node,
java.lang.String name,
java.lang.Object value)
Sets an named attribute for a given node. |
void |
setIdentifier(int i,
Identifier id)
Sets the ith identifier. |
void |
setRoot(Node theRoot)
Called by subclasses that can't give root at time of construction (of this class) |
protected void |
setSetupLengthsAndHeights(boolean value)
Set whether or not this class should call methods to adjust either heights or lengths automatically |
void |
setUnits(int units)
Sets the units that this tree is expressed in. |
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.tree.Tree |
|---|
getCopy |
| Constructor Detail |
|---|
protected Tree.TreeBase(Node theRoot)
theRoot - the node to base tree onprotected Tree.TreeBase()
protected Tree.TreeBase(Tree.TreeBase tree,
Node newRoot)
| Method Detail |
|---|
public void setRoot(Node theRoot)
setRoot in interface TreetheRoot - the root node of the tree to construct.public final int getUnits()
getUnits in interface UnitsProvidergetUnits in interface Treepublic final void setUnits(int units)
public final int getExternalNodeCount()
getExternalNodeCount in interface Treepublic final Node getExternalNode(int i)
getExternalNode in interface Treepublic final int getInternalNodeCount()
getInternalNodeCount in interface Treepublic final Node getInternalNode(int i)
getInternalNode in interface Treepublic final Node getRoot()
getRoot in interface Treepublic Node findNode(int num)
num - number of node
public void createNodeList()
createNodeList in interface Treeprotected void setSetupLengthsAndHeights(boolean value)
public java.lang.String toString()
toString in class java.lang.Object
public void setAttribute(Node node,
java.lang.String name,
java.lang.Object value)
setAttribute in interface Treenode - the node whose attribute is being set.name - the name of the attribute.value - the new value of the attribute.
public java.lang.Object getAttribute(Node node,
java.lang.String name)
getAttribute in interface Treenode - the node being interrogated.name - the name of the attribute of interest.
public void reroot(int num)
num - number of nodepublic void reroot(Node node)
node - the node to make the root.public int getIdCount()
IdGroup
getIdCount in interface IdGrouppublic Identifier getIdentifier(int i)
IdGroup
getIdentifier in interface IdGroup
public void setIdentifier(int i,
Identifier id)
IdGroup
setIdentifier in interface IdGrouppublic int whichIdNumber(java.lang.String s)
IdGroup
whichIdNumber in interface IdGrouppublic void report(java.io.PrintWriter out)
Report
report in interface Reportout - output stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||