Package org.jtool.pdg
Class DependencyGraph
java.lang.Object
org.jtool.pdg.DependencyGraph
- Direct Known Subclasses:
SDG
An object storing information on a dependency graph consisting of ClDGs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a ClDG to this dependency graph.void
add
(DependencyGraphEdge edge) Adds an edge to this dependency graph.void
Adds a PDG to to this dependency graph.void
Adds a node to this dependency graph.void
Adds an edge that uncovers an field access.boolean
boolean
equals
(DependencyGraph graph) Tests if a given dependency graph is equal to this dependency graph.boolean
existsUncoveredFieldAccessEdge
(PDGNode src, PDGNode dst) Tests there is a dependence edge that uncovers field accesses, connecting two nodes.Returns all control dependence edges of this dependency graph.Finds a ClDG having a given name from ClDGs contained in this dependency graph.Finds a ClDG corresponding to a given class from ClDGs contained in this dependency graph.getClDGs()
Returns ClDGs contained in this dependency graph.Returns all data dependence edges of this dependency graph.getEdges()
Returns all edges of this dependency graph.getIncomingCDEdges
(PDGNode node) Obtains control dependence edges incoming to a given node.getIncomingDDEdges
(PDGNode node) Obtains data dependence edges incoming to this node.getIncomingEdges
(PDGNode node) Obtains dependence edges incoming to a given node.Obtains edges that connect nodes in different PDGs.getName()
Returns the name of this dependency graph.getNodes()
Returns all nodes of this dependency graph.getOutgoingCDEdges
(PDGNode node) Obtains control dependence edges outgoing from a given node.getOutgoingDDEdges
(PDGNode node) Obtains data dependence edges outgoing from a given node.getOutgoingEdges
(PDGNode node) Obtains dependence edges outgoing from a given node.Finds a PDG having a given name from PDGs contained in this dependency graph.Finds a PDG corresponding to a given field from PDGs contained in this dependency graph.getPDG
(JavaMethod jmethod) Finds a PDG corresponding to a given method from PDGs contained in this dependency graph.getPDGs()
Returns PDGs contained in this dependency graph.int
hashCode()
void
print()
Displays information on this graph.toString()
Obtains information on this dependency graph.
-
Constructor Details
-
DependencyGraph
Creates a dependency graph. This method is not intended to be invoked by clients.- Parameters:
name
- the name to be set
-
-
Method Details
-
getName
Returns the name of this dependency graph.- Returns:
- the name
-
add
Adds a ClDG to this dependency graph.- Parameters:
cldg
- the ClDG to be added
-
add
Adds a PDG to to this dependency graph.- Parameters:
pdg
- the PDG to be added
-
getClDGs
Returns ClDGs contained in this dependency graph.- Returns:
- the collection of all the contained ClDGs
-
getPDGs
Returns PDGs contained in this dependency graph.- Returns:
- the collection of all the contained PDGs
-
getClDG
Finds a ClDG having a given name from ClDGs contained in this dependency graph.- Parameters:
fqn
- the fully-qualified name of the ClDG to be retrieved- Returns:
- the found ClDG, or
null
if the corresponding ClDG is not found
-
getPDG
Finds a PDG having a given name from PDGs contained in this dependency graph.- Parameters:
fqn
- the fully-qualified name of the PDG to be retrieved- Returns:
- the found PDG, or
null
if the corresponding PDG is not found
-
getClDG
Finds a ClDG corresponding to a given class from ClDGs contained in this dependency graph.- Parameters:
jclass
- the class for the ClDG to be retrieved- Returns:
- the found ClDG, or
null
if the corresponding ClDG is not found
-
getPDG
Finds a PDG corresponding to a given method from PDGs contained in this dependency graph.- Parameters:
jmethod
- the method for the PDG to be retrieved- Returns:
- the found PDG, or
null
if the corresponding PDG is not found
-
getPDG
Finds a PDG corresponding to a given field from PDGs contained in this dependency graph.- Parameters:
jfield
- the field for the PDG to be retrieved- Returns:
- the found PDG, or
null
if the corresponding PDG is not found
-
add
Adds a node to this dependency graph. This method is not intended to be invoked by clients.- Parameters:
node
- the node to be added
-
add
Adds an edge to this dependency graph. This method is not intended to be invoked by clients.- Parameters:
edge
- the dependence edge to be added
-
getNodes
Returns all nodes of this dependency graph.- Returns:
- the collection of the nodes
-
getEdges
Returns all edges of this dependency graph.- Returns:
- the collection of the edges
-
getCDEdges
Returns all control dependence edges of this dependency graph.- Returns:
- the collection of the edges
-
getDDEdges
Returns all data dependence edges of this dependency graph.- Returns:
- the collection of the edges
-
getInterPDGEdges
Obtains edges that connect nodes in different PDGs.- Returns:
- the collection of the edges
-
getIncomingEdges
Obtains dependence edges incoming to a given node.- Parameters:
node
- the node- Returns:
- the collection of the incoming edges
-
getIncomingCDEdges
Obtains control dependence edges incoming to a given node.- Parameters:
node
- the node- Returns:
- the collection of the incoming edges
-
getIncomingDDEdges
Obtains data dependence edges incoming to this node.- Parameters:
node
- the node- Returns:
- the collection of the incoming edges
-
getOutgoingEdges
Obtains dependence edges outgoing from a given node.- Parameters:
node
- the node- Returns:
- the collection of the outgoing edges
-
getOutgoingCDEdges
Obtains control dependence edges outgoing from a given node.- Parameters:
node
- the node- Returns:
- the collection of the outgoing edges
-
getOutgoingDDEdges
Obtains data dependence edges outgoing from a given node.- Parameters:
node
- the node- Returns:
- the collection of the outgoing edges
-
addUncoveredFieldAccessEdge
Adds an edge that uncovers an field access. This method is not intended to be invoked by clients.- Parameters:
edge
- the edge to be added
-
existsUncoveredFieldAccessEdge
Tests there is a dependence edge that uncovers field accesses, connecting two nodes.- Parameters:
src
- the source nodedst
- the destination node- Returns:
true
if a dependence edge was found, otherwisefalse
-
equals
-
equals
Tests if a given dependency graph is equal to this dependency graph.- Parameters:
graph
- the dependency graph to be checked- Returns:
true
if the given dependency graph is equal to this dependency graph
-
hashCode
public int hashCode() -
print
public void print()Displays information on this graph. -
toString
Obtains information on this dependency graph.
-