Class MethodDependencyGraph
java.lang.Object
org.jgrapht.graph.AbstractGraph<V,E>
org.jgrapht.graph.AbstractBaseGraph<V,E>
org.jgrapht.graph.DirectedPseudograph<V,E>
org.jgrapht.graph.DirectedWeightedPseudograph<Method,org.jgrapht.graph.DefaultWeightedEdge>
edu.university.ecs.lab.common.models.sdg.MethodDependencyGraph
- All Implemented Interfaces:
DependencyGraphI<Method,,org.jgrapht.graph.DefaultWeightedEdge> JsonSerializable,Serializable,Cloneable,org.jgrapht.Graph<Method,org.jgrapht.graph.DefaultWeightedEdge>
public class MethodDependencyGraph
extends org.jgrapht.graph.DirectedWeightedPseudograph<Method,org.jgrapht.graph.DefaultWeightedEdge>
implements DependencyGraphI<Method,org.jgrapht.graph.DefaultWeightedEdge>
Represents a dependency graph for service methods
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass to serialize an endpoint as a json objectclassClass to serialize an endpoint as a json objectstatic classClass to serialize a method as a json object -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanWhether the edges are interpreted as directedprivate final StringRepresents the name of the graphprivate final booleanWhether several edges between source and target are allowedprivate final StringThe timestamp of the current Network graph (i.e.Fields inherited from interface org.jgrapht.Graph
DEFAULT_EDGE_WEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionMethodDependencyGraph(MicroserviceSystem microserviceSystem) Create a new method dependency graph from a given microservice system -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddUpdateEdge(Method source, Method target) Method to add and edge or update its weight if it already existscom.google.gson.JsonObjectMethods inherited from class org.jgrapht.graph.DirectedWeightedPseudograph
createBuilder, createBuilderMethods inherited from class org.jgrapht.graph.AbstractBaseGraph
addEdge, addEdge, addVertex, addVertex, clone, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeSource, getEdgeSupplier, getEdgeTarget, getEdgeWeight, getType, getVertexSupplier, incomingEdgesOf, inDegreeOf, iterables, outDegreeOf, outgoingEdgesOf, removeEdge, removeEdge, removeVertex, setEdgeSupplier, setEdgeWeight, setVertexSupplier, vertexSetMethods inherited from class org.jgrapht.graph.AbstractGraph
assertVertexExist, containsEdge, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSetsMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.university.ecs.lab.common.models.sdg.DependencyGraphI
getAdjacency, getAdjacency, getLabel, getTimestamp, isDirected, isMultigraphMethods inherited from interface org.jgrapht.Graph
addEdge, addEdge, addVertex, addVertex, containsEdge, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeSource, getEdgeSupplier, getEdgeTarget, getEdgeWeight, getType, getVertexSupplier, incomingEdgesOf, inDegreeOf, iterables, outDegreeOf, outgoingEdgesOf, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, setEdgeWeight, setEdgeWeight, vertexSet
-
Field Details
-
label
Represents the name of the graph -
timestamp
The timestamp of the current Network graph (i.e. the commit ID that the Network graph represents) -
directed
private final boolean directedWhether the edges are interpreted as directed- See Also:
-
multigraph
private final boolean multigraphWhether several edges between source and target are allowed- See Also:
-
-
Constructor Details
-
MethodDependencyGraph
Create a new method dependency graph from a given microservice system- Parameters:
microserviceSystem- microservice system from which to derive method dependency graph
-
-
Method Details
-
addUpdateEdge
Method to add and edge or update its weight if it already exists- Parameters:
source- method making the calltarget- method being called
-
toJsonObject
public com.google.gson.JsonObject toJsonObject()- Specified by:
toJsonObjectin interfaceDependencyGraphI<Method,org.jgrapht.graph.DefaultWeightedEdge> - Specified by:
toJsonObjectin interfaceJsonSerializable- Returns:
- a JsonObject representing this
-