Returns the Edge that connects these two nodes @param node1 @param node2 @return the edge object. @throws jebl.evolution.graphs.Graph.NoEdgeException if the nodes are not directly connected by an edge.
(Node node1, Node node2)
| 382 | * if the nodes are not directly connected by an edge. |
| 383 | */ |
| 384 | public Edge getEdge(Node node1, Node node2) throws NoEdgeException { |
| 385 | if (((ReRootedNode)node1).getParent() == node2) { |
| 386 | return ((ReRootedNode)node1).getEdge(); |
| 387 | } else if (((ReRootedNode)node2).getParent() == node1) { |
| 388 | return ((ReRootedNode)node2).getEdge(); |
| 389 | } else { |
| 390 | throw new NoEdgeException(); |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * @param node1 |
no test coverage detected