Class GraphUtils

java.lang.Object
org.pgcodekeeper.core.model.graph.GraphUtils

public final class GraphUtils extends Object
Utility class for working with dependency graphs. Provides methods for traversing dependency graphs in forward and reverse directions using depth-first search algorithms.
  • Method Details

    • reverse

      public static List<IStatement> reverse(DepcyGraph depcyGraph, IStatement statement)
      Gets all statements that depend on the given statement (reverse dependencies). Performs depth-first search traversal to find ALL dependent objects at any depth level, without limitations on traversal depth. This ensures complete dependency resolution for complex multi-level dependency chains.
      Parameters:
      depcyGraph - the dependency graph to traverse
      statement - the statement to find dependents for
      Returns:
      list of all statements that directly or indirectly depend on the given statement
    • forward

      public static List<IStatement> forward(DepcyGraph depcyGraph, IStatement statement)
      Gets all statements that the given statement depends on (forward dependencies). Performs depth-first search traversal to find ALL dependency objects at any depth level, without limitations on traversal depth. This ensures complete dependency resolution for complex multi-level dependency chains.
      Parameters:
      depcyGraph - the dependency graph to traverse
      statement - the statement to find dependencies for
      Returns:
      list of all statements that the given statement directly or indirectly depends on