Once a SimpleRootedTree has been created, the node stucture can be created by calling createExternalNode and createInternalNode. First of all createExternalNode is called giving Taxon objects for the external nodes. Then these are put into sets and passed to createInternalNode to create a parent of
(Node source, List<? extends Node> children)
| 150 | * @return the created node reference |
| 151 | */ |
| 152 | private ReRootedNode createInternalNode(Node source, List<? extends Node> children) { |
| 153 | ReRootedNode node = new ReRootedNode(source, children); |
| 154 | |
| 155 | for (Node child : children) { |
| 156 | ((ReRootedNode)child).setParent(node); |
| 157 | } |
| 158 | |
| 159 | internalNodes.add(node); |
| 160 | |
| 161 | rootNode = node; |
| 162 | return node; |
| 163 | } |
| 164 | |
| 165 | public Node getSourceNode(Node node) { |
| 166 | return ((ReRootedNode)node).source; |
no test coverage detected