Package org.jtool.cfg
Class CFGMethodEntry
java.lang.Object
org.jtool.graph.GraphElement
org.jtool.graph.GraphNode
org.jtool.cfg.CFGNode
org.jtool.cfg.CFGEntry
org.jtool.cfg.CFGMethodEntry
The entry node for a CFG for a method or a constructor.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jtool.cfg.CFGNode
CFGNode.Kind
-
Field Summary
Fields inherited from class org.jtool.graph.GraphNode
id, incomingEdges, outgoingEdges
-
Constructor Summary
ConstructorsConstructorDescriptionCFGMethodEntry
(JavaMethod jmethod, CFGNode.Kind kind) Creates a new object that represents an entry for a method. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExceptionNode
(CFGException node) Adds an exception node to this method entry.void
addFormalIn
(CFGParameter node) Adds a formal-in node to this method entry node.getExceptionNode
(String type) Finds the exception node related to a specified type/Returns the exception nodes corresponding tothrows
on this method entry.getFormalIn
(int index) Returns an formal-in node of a parameter specified by the index.Returns formal-in nodes of the method associated to this entry node.Returns an formal-out node of a parameter for the return value.Returns the method associated with this entry node.int
Returns the number of parameters of the method associated to this entry node.boolean
Tests if the method associated to this entry node has a parameter.void
setFormalIns
(List<CFGParameter> nodes) Sets formal-in nodes to this method entry node.void
setFormalOut
(CFGParameter node) Sets a formal-out node for the return value to this method entry node.toString()
Obtains information on this node.Methods inherited from class org.jtool.cfg.CFGEntry
getCFG, getQualifiedName, getSignature, setCFG
Methods inherited from class org.jtool.cfg.CFGNode
equals, equals, getASTNode, getIncomingFalseFlows, getIncomingFlows, getIncomingTrueFlows, getKind, getNumOfPredecessors, getNumOfSuccessors, getOutgoingFalseFlow, getOutgoingFlows, getOutgoingTrueFlow, getPDGNode, getPredecessors, getSuccessors, hasDefVariable, hashCode, hasUseVariable, isActual, isActualIn, isActualOut, isAssert, isAssignment, isBranch, isBreak, isCatchClause, isClassEntry, isConstructorEntry, isContinue, isDo, isDummy, isEnhancedFor, isEntry, isEnumConstantEntry, isEnumEntry, isExit, isExpression, isFieldDeclaration, isFieldEntry, isFinallyClause, isFor, isFormal, isFormalIn, isFormalOut, isIf, isInitializerEntry, isInterfaceEntry, isJoin, isLabel, isLiteral, isLocalDeclaration, isLoop, isMerge, isMethodCall, isMethodEntry, isNextToBranch, isParameter, isReceiver, isReturn, isSelection, isStatement, isStatement, isStatementNotParameter, isSwitch, isSwitchCase, isSwitchDefault, isSynchronized, isThrow, isThrowClause, isTry, isWhile, print, resetId, setASTNode, setKind, setPDGNode, sortNodes, sortNodesInverse
Methods inherited from class org.jtool.graph.GraphNode
addIncomingEdge, addIncomingEdges, addOutgoingEdge, addOutgoingEdges, clear, equals, equals, getDstNodes, getId, getIncomingEdges, getOutgoingEdges, getSrcNodes, removeIncomingEdge, removeOutgoingEdge, setId, sortGraphNode
Methods inherited from class org.jtool.graph.GraphElement
difference, equals, getIdString, intersection, subset, subsetEqual, union
-
Constructor Details
-
CFGMethodEntry
Creates a new object that represents an entry for a method. This method is not intended to be invoked by clients.- Parameters:
jmethod
- the method associated with this entry nodekind
- the kind of this node
-
-
Method Details
-
getJavaMethod
Returns the method associated with this entry node.- Returns:
- the associated method
-
addFormalIn
Adds a formal-in node to this method entry node. This method is not intended to be invoked by clients.- Parameters:
node
- the formal-in node to be added
-
setFormalIns
Sets formal-in nodes to this method entry node. This method is not intended to be invoked by clients.- Parameters:
nodes
- the collection of the formal-in nodes to be set
-
setFormalOut
Sets a formal-out node for the return value to this method entry node.- Parameters:
node
- the formal-out node to be set
-
getFormalIns
Returns formal-in nodes of the method associated to this entry node.- Returns:
- the collection of the formal-in nodes
-
getParameterSize
public int getParameterSize()Returns the number of parameters of the method associated to this entry node.- Returns:
- the number of the parameters
-
getFormalIn
Returns an formal-in node of a parameter specified by the index.- Parameters:
index
- the index number of the parameter to be retrieved- Returns:
- the found formal-in node, or
null
if no parameter is found
-
getFormalOut
Returns an formal-out node of a parameter for the return value.- Returns:
- the formal-out node for the return value
-
hasParameters
public boolean hasParameters()Tests if the method associated to this entry node has a parameter.- Returns:
true
if any parameter exists, otherwisefalse
-
addExceptionNode
Adds an exception node to this method entry. This method is not intended to be invoked by clients.- Parameters:
node
- the exception node to be added
-
getExceptionNodes
Returns the exception nodes corresponding tothrows
on this method entry.- Returns:
- the collection of the exception nodes
-
getExceptionNode
Finds the exception node related to a specified type/- Parameters:
type
- the type of the exception- Returns:
- the found exception node, or
null
if no exception type is found
-
toString
Obtains information on this node.
-