Class DependencyGraph<V>
java.lang.Object
com.atlassian.plugin.webresource.graph.DependencyGraph<V>
- Type Parameters:
V- The vertex type.
Maps the dependencies between items of a given type, where the vertex is the item and the edge is their dependency relation.
-
Constructor Summary
ConstructorsConstructorDescriptionDependencyGraph(Class<V> verticeClazz) DependencyGraph(Class<V> verticeClazz, org.jgrapht.Graph<V, DependencyEdge> resourceGraph) -
Method Summary
Modifier and TypeMethodDescriptionstatic DependencyGraphBuilderbuilder()booleanfindCyclicSubGraphByVertex(V sourceKey) Identify all the cycles contained inside the graph.findDependantsSubGraphByKey(V sourceKey) Retrieve a sub graph of dependants based on a certain source requestable key.findDependencySubGraphByRequestableKey(V sourceKey) Retrieve a sub graph of dependency based on a certain source requestable key.findIntersectionSubGraph(V sourceKey, V targetKey) Find the intersection between two sub-graphs generated based on a source requestable key and target requestable key.getEdges()booleanhasDependency(V key) inthashCode()toString()
-
Constructor Details
-
DependencyGraph
-
DependencyGraph
public DependencyGraph(@Nonnull Class<V> verticeClazz, @Nonnull org.jgrapht.Graph<V, DependencyEdge> resourceGraph)
-
-
Method Details
-
builder
-
equals
-
findCyclicSubGraphByVertex
Identify all the cycles contained inside the graph.- Parameters:
sourceKey- The source requestable resource key used as start point.- Returns:
- A map where the key is the requestable and the value is the subgraph for
-
findDependantsSubGraphByKey
Retrieve a sub graph of dependants based on a certain source requestable key.- Parameters:
sourceKey- The source requestable resource key used as start point.- Returns:
- The dependency graph.
-
findDependencySubGraphByRequestableKey
Retrieve a sub graph of dependency based on a certain source requestable key.- Parameters:
sourceKey- The source requestable key used as start point.- Returns:
- The dependency graph.
-
findIntersectionSubGraph
@Nonnull public DependencyGraph<V> findIntersectionSubGraph(@Nonnull V sourceKey, @Nonnull V targetKey) Find the intersection between two sub-graphs generated based on a source requestable key and target requestable key.- Parameters:
sourceKey- The source requestable key used as start point for the first sub-graph to compare.targetKey- The target requestable key used start point for the second sub-graph to compare.- Returns:
- The dependency graph representing the intersection between both graphs.
-
hashCode
public int hashCode() -
toString
-
getEdges
-
hasDependency
-