|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgrapht.graph.AbstractGraph<V,E> org.jgrapht.graph.AbstractBaseGraph<V,E> org.jgrapht.graph.DefaultDirectedGraph<Vertex,Edge> edu.uci.eecs.doc.cascade.graph.Graph
public class Graph
A control flow graph (CFG) of a Java method.
Tree
,
Serialized FormConstructor Summary | |
---|---|
Graph(List<String> classPath,
Method method)
Creates a new control flow graph. |
|
Graph(List<String> classPath,
Method method,
Tree caller,
Field invokingField,
boolean includeCacheMissBlocks)
Creates a new control flow graph. |
|
Graph(Tree tree)
Creates a new control flow graph based on the given control flow tree. |
|
Graph(Tree tree,
boolean includeCacheMissBlocks)
Creates a new control flow graph based on the given control flow tree. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Compares this graph to the specified object. |
Set<BasicBlock> |
getBasicBlocks()
Returns the set of vertices in this CFG, excluding the entry and exit vertices. |
List<String> |
getClassPath()
Returns the class path that was specified when the underlying control flow tree was created. |
Entry |
getEntry()
Returns the entry point of this CFG. |
Exit |
getExit()
Returns the exit point of this CFG. |
LoopBlock |
getLoopBlock(Loop loop)
Searches the graph for the loop block corresponding to the given loop node. |
Method |
getMethod()
Returns the method from which this control flow graph was constructed. |
List<Graph> |
getMethodGraphs()
Returns a list containing this graph and the graphs of any methods that it invokes |
Set<Method> |
getMethodInvocations()
Returns the methods that this graph invokes. |
Map<Node,Set<BasicBlock>> |
getNodeBlockMap()
Returns a mapping from nodes in the control flow tree to their corresponding basic blocks in the control flow graph. |
Tree |
getTree()
Returns the control flow tree from which this control flow graph was constructed. |
int |
hashCode()
Returns a hash code for this graph. |
String |
toString()
Returns a simple one-line string describing the method represented by this graph. |
Methods inherited from class org.jgrapht.graph.AbstractBaseGraph |
---|
addEdge, addEdge, addVertex, clone, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, incomingEdgesOf, inDegreeOf, isAllowingLoops, isAllowingMultipleEdges, outDegreeOf, outgoingEdgesOf, removeEdge, removeEdge, removeVertex, setEdgeSetFactory, setEdgeWeight, vertexSet |
Methods inherited from class org.jgrapht.graph.AbstractGraph |
---|
assertVertexExist, containsEdge, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toStringFromSets |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jgrapht.DirectedGraph |
---|
incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf |
Methods inherited from interface org.jgrapht.Graph |
---|
addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet |
Constructor Detail |
---|
public Graph(List<String> classPath, Method method) throws IOException, NoSuchMethodException, ClassNotFoundException
Graph(Tree)
constructor instead.
classPath
- a list of directories that will be searched when loading
classes during control flow constructionmethod
- the method whose control flow graph should be created
IOException
- if the method cannot be loaded
NoSuchMethodException
- if the method cannot be found or if a method that it calls cannot be found
ClassNotFoundException
- if the method calls another method and its class cannot be foundGraph(Tree)
public Graph(List<String> classPath, Method method, Tree caller, Field invokingField, boolean includeCacheMissBlocks) throws IOException, NoSuchMethodException, ClassNotFoundException
Graph(Tree)
constructor instead.
classPath
- a list of directories that will be searched when loading
classes during control flow constructionmethod
- the method whose control flow graph should be createdincludeCacheMissBlocks
- if true, every method invocation is preceded by an InvokeMiss block
and every return instruction by a ReturnMiss block; if false, no such blocks appear in the graph
IOException
- if the method cannot be loaded
NoSuchMethodException
- if the method cannot be found or if a method that it calls cannot be found
ClassNotFoundException
- if the method calls another method and its class cannot be foundGraph(Tree)
public Graph(Tree tree) throws NoSuchMethodException, ClassNotFoundException, IOException
tree
- a control flow tree to be used as the basis of the CFG
NoSuchMethodException
- if the method calls another method and it cannot be found
ClassNotFoundException
- if the method calls another method and its class cannot be found
IOException
- if the method calls another method and it cannot be loadedpublic Graph(Tree tree, boolean includeCacheMissBlocks) throws NoSuchMethodException, ClassNotFoundException, IOException
tree
- a control flow tree to be used as the basis of the CFGincludeCacheMissBlocks
- if true, every method invocation is preceded by an InvokeMiss block
and every return instruction by a ReturnMiss block; if false, no such blocks appear in the graph
NoSuchMethodException
- if the method calls another method and it cannot be found
ClassNotFoundException
- if the method calls another method and its class cannot be found
IOException
- if the method calls another method and it cannot be loadedMethod Detail |
---|
public Tree getTree()
public Method getMethod()
public List<String> getClassPath()
public Set<Method> getMethodInvocations()
public Entry getEntry()
public Exit getExit()
public Set<BasicBlock> getBasicBlocks()
public Map<Node,Set<BasicBlock>> getNodeBlockMap()
public List<Graph> getMethodGraphs()
public LoopBlock getLoopBlock(Loop loop)
loop
- a loop node
public boolean equals(Object obj)
Graph
object whose underlying tree is equivalent
to this graph's underlying tree.
equals
in class Object
obj
- the object to compare this graph against
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class AbstractGraph<Vertex,Edge>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |