/** * Returns the children of a node. * * @param node The node. * @return The children of {@code node} */ public Iterable<N> getChildren(N node) { Checks.isNotNull(node, NODE); return adapter.getChildren(node); }
private void build(N node) { nodes.add(node); if (tree.hasChildren(node)) { final Set<BasicGraphEdge<N>> tmp = new HashSet<>(); for (final N child : tree.getChildren(node)) { final BasicGraphEdge<N> edge = new BasicGraphEdge<>(node, child); edges.add(edge); tmp.add(edge); } nodesToEdges.put(node, tmp); } }