diff --git a/src/main/java/io/github/bldl/graph/ClassHierarchyGraph.java b/src/main/java/io/github/bldl/graph/ClassHierarchyGraph.java index 7f6f979..8032f28 100644 --- a/src/main/java/io/github/bldl/graph/ClassHierarchyGraph.java +++ b/src/main/java/io/github/bldl/graph/ClassHierarchyGraph.java @@ -60,6 +60,13 @@ public Iterable getVertices() { return vertices; } + /** + * Determines whether one node is a descendant of another + * + * @param ancestor the presumed ancestor + * @param descendant the presumed descendant + * @return whether {@code descendant} is a descendant of {@code ancestor} + */ public boolean isDescendant(T ancestor, T descendant) { Set visited = new HashSet<>(); dfs(ancestor, visited);