@param node the node whose parent is requested @return the parent node of the given node, or null if the node is the root node.
(Node node)
| 252 | * if the node is the root node. |
| 253 | */ |
| 254 | public Node getParent(Node node) { |
| 255 | if (!(node instanceof ReRootedNode)) { |
| 256 | throw new IllegalArgumentException("Node, " + node.toString() + " is not an instance of SimpleRootedNode"); |
| 257 | } |
| 258 | return ((ReRootedNode)node).getParent(); |
| 259 | } |
| 260 | |
| 261 | public Edge getParentEdge(Node node) { |
| 262 | if (!(node instanceof ReRootedNode)) { |
no test coverage detected