Skip to content

Commit

Permalink
add javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixAnthonisen committed Nov 16, 2024
1 parent e43a098 commit e40ba30
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/io/github/bldl/graph/ClassHierarchyGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ public Iterable<T> 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<T> visited = new HashSet<>();
dfs(ancestor, visited);
Expand Down

0 comments on commit e40ba30

Please sign in to comment.