|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--AccordionTreeDrawer.Tree
A public class representing a (phylognenetic) tree. Nodes of the tree are of type TreeNode. Nodes are traversed in pre- and post-orders.
TreeNode,
Newick,
Nexus,
Status| Field Summary | |
private int |
height
|
private int |
key
key should be unique for each tree, set by object that creates trees |
private int |
leafCount
the number of leave nodes |
(package private) float |
leafSpace
|
(package private) TreeNode |
leftmostLeaf
|
(package private) java.lang.String |
name
|
private int |
nodeCount
total number of nodes for the tree |
java.util.ArrayList |
nodes
The list of nodes of the tree indexed by their keys, indexed by key |
(package private) java.util.HashMap |
nodesByName
Most internal nodes don't have names. |
(package private) static Newick |
parser
the parser responsible for parsing Newick format file, normally with a suffix nh |
(package private) static Parser.nexus.Nexus |
parser_nexus
the parser responsible for parsing Nexus format file, normally with a suffix nexus or nxs |
TreeNode |
posorderStartNode
the start node for postorder list of all the nodes |
TreeNode |
preorderStartNode
the start node for preorder list of all the nodes |
(package private) TreeNode |
root
|
| Constructor Summary | |
Tree()
|
|
Tree(java.lang.String tn)
|
|
Tree(Tree t)
|
|
Tree(TreeNode rn)
|
|
| Method Summary | |
void |
close()
clean up method, called when the tree is deleted |
int |
computeBin(int fontRange)
|
protected void |
finalize()
|
(package private) int |
getGapDistanceFromLeaves(TreeNode n1,
TreeNode n2)
|
(package private) int |
getHeight()
|
(package private) int |
getInteriorCount()
|
int |
getKey()
|
(package private) int |
getLCADistanceFromLeaves(TreeNode n1,
TreeNode n2)
|
int |
getLeafCount()
|
TreeNode |
getLeftmostLeaf()
|
java.lang.String |
getName()
|
TreeNode |
getNodeByKey(int key)
|
TreeNode |
getNodeByName(java.lang.String s)
|
TreeNode |
getRightmostLeaf()
|
TreeNode |
getRoot()
|
int |
getSize()
|
(package private) int |
getTotalNodeCount()
|
private void |
linkLeaves()
Links leaves of the tree in pre-order check to see whether leaves have distinct names if leaves have the same name, add a suffix index separated by ":" |
private void |
linkNodesInPosorder()
Traverses the tree in pos-order, stores the ordering in the posorderNext field of TreeNodes |
private void |
linkNodesInPreorder()
Traverses the tree in pre-order, stores the ordering in the preorderNext field of TreeNodes Sets nodecount for the tree |
private void |
linkSubtreeNodesInPosorder(TreeNode n)
Traverses the subtree rooted at TreeNode n in post-order, stores the ordering in the posorderNext field of TreeNodes. |
private void |
linkSubtreeNodesInPreorder(TreeNode n)
Traverses the subtree rooted at TreeNode n in pre-order, stores the ordering in the preorderNext field of TreeNodes. |
void |
load_nexus(java.lang.String fname,
int index)
Reads a tree with giving index in a file fname with Nexus format and initiates the Tree object. |
void |
load(java.lang.String fname)
Reads a tree in file fname described in Newick format and initiate the tree object. |
void |
postProcess()
Post processing includes computing size of each node, linking nodes in different order, etc. |
void |
printLeaves()
|
(package private) void |
printName()
|
void |
setKey(int i)
|
(package private) void |
setName(java.lang.String tn)
|
void |
setNodeFontSize(int maxFontSize,
int minFontSize)
|
(package private) void |
setRoot(TreeNode rn)
|
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
static Newick parser
static Parser.nexus.Nexus parser_nexus
public java.util.ArrayList nodes
java.util.HashMap nodesByName
private int nodeCount
private int key
private int height
java.lang.String name
TreeNode root
TreeNode leftmostLeaf
float leafSpace
private int leafCount
public TreeNode preorderStartNode
public TreeNode posorderStartNode
| Constructor Detail |
public Tree()
public Tree(java.lang.String tn)
public Tree(TreeNode rn)
public Tree(Tree t)
| Method Detail |
public void close()
TreeJuxtaposer.TreeJuxtaposer.deleteTree,
TreeNode.close
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void load(java.lang.String fname)
fname - The file nameNewick
public void load_nexus(java.lang.String fname,
int index)
fname - The file nameindex - Index of the tree in the nexus fileNexus
int getGapDistanceFromLeaves(TreeNode n1,
TreeNode n2)
int getLCADistanceFromLeaves(TreeNode n1,
TreeNode n2)
int getInteriorCount()
int getTotalNodeCount()
public TreeNode getNodeByKey(int key)
public TreeNode getNodeByName(java.lang.String s)
int getHeight()
public void setKey(int i)
public int getKey()
public java.lang.String getName()
public int getSize()
public TreeNode getLeftmostLeaf()
public TreeNode getRightmostLeaf()
public TreeNode getRoot()
void setRoot(TreeNode rn)
void setName(java.lang.String tn)
void printName()
public int getLeafCount()
public void postProcess()
TreeNodeprivate void linkNodesInPreorder()
TreeNodeprivate void linkSubtreeNodesInPreorder(TreeNode n)
n - the root of the subtreeTreeNodeprivate void linkNodesInPosorder()
TreeNodeprivate void linkSubtreeNodesInPosorder(TreeNode n)
n - the root of the subtreeTreeNodeprivate void linkLeaves()
linkNodesInPreorder(),
TreeNode,
NameComparatorpublic void printLeaves()
public int computeBin(int fontRange)
public void setNodeFontSize(int maxFontSize,
int minFontSize)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||