/** * Traverse the graph starting at the provided node. * @param startingNode starting node. * @return a List containing the DFS traversal starting at the node. * @throws CircularDependencyException if there is a circular dependency in the loaded traversal. */ List<T> traverseGraphRecursively(T startingNode) { return doTraverseGraphRecursively(startingNode, new NodePath<>(startingNode)); }
/** * Add a sub-traversal for a neighboring node. */ private void addSubtraversal(T node, LinkedList<T> imports, Set<T> alreadyIncludedImports, NodePath<T> nodePath) throws ExecutionException { if (addNodeIfNotAlreadyIncluded(node, imports, alreadyIncludedImports)) { for (T inheritedFromParent : doTraverseGraphRecursively(node, nodePath)) { addNodeIfNotAlreadyIncluded(inheritedFromParent, imports, alreadyIncludedImports); } } }
/** * Traverse the graph starting at the provided node. * @param startingNode starting node. * @return a List containing the DFS traversal starting at the node. * @throws CircularDependencyException if there is a circular dependency in the loaded traversal. */ List<T> traverseGraphRecursively(T startingNode) { return doTraverseGraphRecursively(startingNode, new NodePath<>(startingNode)); }
/** * Add a sub-traversal for a neighboring node. */ private void addSubtraversal(T node, LinkedList<T> imports, Set<T> alreadyIncludedImports, NodePath<T> nodePath) throws ExecutionException { if (addNodeIfNotAlreadyIncluded(node, imports, alreadyIncludedImports)) { for (T inheritedFromParent : doTraverseGraphRecursively(node, nodePath)) { addNodeIfNotAlreadyIncluded(inheritedFromParent, imports, alreadyIncludedImports); } } }