Class DependencyGraph

java.lang.Object
org.savantbuild.util.HashGraph<DependencyGraph.Dependency,DependencyEdgeValue>
org.savantbuild.dep.graph.DependencyGraph
All Implemented Interfaces:
org.savantbuild.util.Graph<DependencyGraph.Dependency,DependencyEdgeValue>

public class DependencyGraph extends org.savantbuild.util.HashGraph<DependencyGraph.Dependency,DependencyEdgeValue>
This class is an artifact and dependency version of the Graph.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class org.savantbuild.util.HashGraph

    org.savantbuild.util.HashGraph.HashEdge<T extends Object,U extends Object>, org.savantbuild.util.HashGraph.HashNode<T extends Object,U extends Object>

    Nested classes/interfaces inherited from interface org.savantbuild.util.Graph

    org.savantbuild.util.Graph.BasePath<T extends Object>, org.savantbuild.util.Graph.Edge<T extends Object,U extends Object>, org.savantbuild.util.Graph.EdgeFilter<T extends Object,U extends Object>, org.savantbuild.util.Graph.GraphConsumer<T extends Object,U extends Object>, org.savantbuild.util.Graph.GraphVisitor<T extends Object,U extends Object>, org.savantbuild.util.Graph.Path<T extends Object>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    void
     
    Outputs this DependencyGraph as a GraphViz DOT file.
     
    void
    versionCorrectTraversal(org.savantbuild.util.Graph.GraphConsumer<DependencyGraph.Dependency,DependencyEdgeValue> consumer)
    Traverses the dependency graph in a version consistent manner.

    Methods inherited from class org.savantbuild.util.HashGraph

    addEdge, addNode, clearEdges, contains, find, find, getInboundEdges, getNode, getOutboundEdges, getPaths, prune, removeEdge, removeNode, size, traverse, traverse, traverseUp, traverseUp, values

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class org.savantbuild.util.HashGraph<DependencyGraph.Dependency,DependencyEdgeValue>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.savantbuild.util.HashGraph<DependencyGraph.Dependency,DependencyEdgeValue>
    • skipCompatibilityCheck

      public void skipCompatibilityCheck(ArtifactID id)
    • toDOT

      public String toDOT()
      Outputs this DependencyGraph as a GraphViz DOT file.
      Returns:
      The DOT file String.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • versionCorrectTraversal

      public void versionCorrectTraversal(org.savantbuild.util.Graph.GraphConsumer<DependencyGraph.Dependency,DependencyEdgeValue> consumer)
      Traverses the dependency graph in a version consistent manner. This essentially guarantees that at any given node, only the dependencies for the version of the current traversal are followed. For this graph:
         B -1.1----1.2--> C -1.2----1.1--> D
         \--1.2----1.3---/\-1.3----2.0--> E
       

      If we are examining B version 1.1 once we traverse to C, we will only observe D. Likewise, if we are examining B version 1.2, then we will traverse to C version 1.3 and only see E.

      Parameters:
      consumer - The graph consumer.