org.jtool.jxplatform.graph.cfg
Class CFGCall

java.lang.Object
  extended byorg.jtool.jxplatform.graph.GraphNode
      extended byorg.jtool.jxplatform.graph.cfg.CFGNode
          extended byorg.jtool.jxplatform.graph.cfg.CFGStatement
              extended byorg.jtool.jxplatform.graph.cfg.CFGCall
All Implemented Interfaces:
GraphElement, GraphNodeSort

public class CFGCall
extends CFGStatement

A method call node of CFGs.

Author:
Katsuhsa Maruyama

Field Summary
 
Fields inherited from class org.jtool.jxplatform.graph.cfg.CFGStatement
defs, uses
 
Fields inherited from class org.jtool.jxplatform.graph.cfg.CFGNode
defid, element
 
Fields inherited from class org.jtool.jxplatform.graph.GraphNode
id, nodeNum, sort
 
Fields inherited from interface org.jtool.jxplatform.graph.GraphNodeSort
actualIn, actualOut, assignments, assignmentSt, branches, breakSt, callings, caseLabel, classEntry, classExit, constructorCall, constructorEntry, constructorExit, continueSt, defaultLabel, doSt, entries, exits, fieldDecl, formalIn, formalOut, forSt, ifSt, ignores, instanceCreation, interfaceEntry, interfaceExit, labelSt, localDecl, mergeSt, methodCall, methodEntry, methodExit, newSt, parameters, polymorphicCall, returnSt, switchSt, synchronizedSt, throwSt, trySt, whileSt
 
Constructor Summary
protected CFGCall()
          Creates a new, emoty object.
protected CFGCall(int sort, org.w3c.dom.Element elem)
          Creates a new node.
 
Method Summary
protected  void addActualIn(CFGParameter node)
          Adds actual-in node.
protected  void addActualOut(CFGParameter node)
          Adds actual-out node.
protected  boolean callSelf()
          Tests if this method call recursively invokes the method itself.
 CFGParameter getActualIn(int index)
          Returns an argument node at the position in the actual-in list of this method entry.
 java.util.ArrayList getActualIns()
          Returns actual-in nodes of this method call.
 CFGParameter getActualOut(int index)
          Returns an argument node at the position in the actual-out list of this method entry.
 java.util.ArrayList getActualOuts()
          Returns actual-out nodes of this method call.
 java.util.ArrayList getArguments()
          Returns argument nodes of this method call.
 java.lang.String getFqnOfCalledMethod()
          Returns the fully-qualified name of the type of the return value.
 java.lang.String getName()
          Returns the name of a called method.
 int getNumOfArguments()
          Returns the number of arguments.
 JxVariable getReturnVariable()
          Returns a variable wrapper storing the return value.
 boolean hasArguments()
          Tests if this method call has an argument.
 void print(java.lang.StringBuffer buf)
          Collects information about this statement for printing.
protected  void setFqnOfCalledMethod(java.lang.String fqn)
          Sets the fully-qualified name of the type of the return value.
protected  void setName(java.lang.String name)
          Sets the name of a called method.
 
Methods inherited from class org.jtool.jxplatform.graph.cfg.CFGStatement
addDefinedVariable, addDefinedVariables, addDefinedVariables, addUsedVariable, addUsedVariables, addUsedVariables, clearDefinedVariable, clearUsedVariable, definesVariable, getDefinedVariable, getDefinedVariables, getUsedVariable, getUsedVariables, isStatement, printDefUse, removeDefinedVariable, removeUsedVariable, setDefinedVariable, setDefinedVariables, setUsedVariable, setUsedVariables, usesVariable
 
Methods inherited from class org.jtool.jxplatform.graph.cfg.CFGNode
equals, getDefId, getElem, getPredecessors, getPredecessorsNumber, getSuccessors, getSuccessorsNumber, hasDefVariable, hasUseVariable, isAssignmentSt, isBranch, isBranchSt, isBreakSt, isCallSt, isContinueSt, isDoSt, isEntrySt, isExitSt, isFieldSt, isFormalInSt, isFormalOutSt, isFormalSt, isForSt, isGeneralAssignmentSt, isGeneralStatement, isIfSt, isIgnoredSt, isJoin, isLabelSt, isLocalSt, isLoopSt, isMergeSt, isMethodEntry, isParameterSt, isReturnSt, isSwitchLabel, isSwitchSt, isWhileSt, print, print, write
 
Methods inherited from class org.jtool.jxplatform.graph.GraphNode
addIncomingEdge, addIncomingEdges, addOutgoingEdge, addOutgoingEdges, clear, clearId, clearIncomingEdges, clearOutgoingEdges, getDstNodes, getId, getIncomingEdges, getOutgoingEdges, getSort, getSrcNodes, removeIncomingEdge, removeOutgoingEdge, setDstNodes, setIncomingEdges, setOutgoingEdges, setSort, setSrcNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFGCall

protected CFGCall()
Creates a new, emoty object.


CFGCall

protected CFGCall(int sort,
                  org.w3c.dom.Element elem)
Creates a new node.

Parameters:
sort - The sort of this node.
elem - A DOM element corresponding to this node.
Method Detail

setName

protected void setName(java.lang.String name)
Sets the name of a called method.

Parameters:
name - The name of the called method.

getName

public java.lang.String getName()
Returns the name of a called method.

Returns:
The name of the called method.

getReturnVariable

public JxVariable getReturnVariable()
Returns a variable wrapper storing the return value.

Returns:
The variable wrapper, or null if this method call returns no value.

setFqnOfCalledMethod

protected void setFqnOfCalledMethod(java.lang.String fqn)
Sets the fully-qualified name of the type of the return value.

Parameters:
fqn - The fully-qualified name of the type of the return value.

getFqnOfCalledMethod

public java.lang.String getFqnOfCalledMethod()
Returns the fully-qualified name of the type of the return value.

Returns:
The fully-qualified name of the type of the return value.

addActualIn

protected void addActualIn(CFGParameter node)
Adds actual-in node.

Parameters:
node - A actual-in node of CFGs.

addActualOut

protected void addActualOut(CFGParameter node)
Adds actual-out node.

Parameters:
node - A actual-out node of CFGs.

getActualIns

public java.util.ArrayList getActualIns()
Returns actual-in nodes of this method call.

Returns:
The actual-in nodes.

getActualOuts

public java.util.ArrayList getActualOuts()
Returns actual-out nodes of this method call.

Returns:
The actual-out nodes.

getArguments

public java.util.ArrayList getArguments()
Returns argument nodes of this method call.

Returns:
The argument nodes, which is the same as the actual-in nodes.

getNumOfArguments

public int getNumOfArguments()
Returns the number of arguments.

Returns:
The number of argument nodes.

hasArguments

public boolean hasArguments()
Tests if this method call has an argument.

Returns:
true if this method call has an argument, otherwise false.

getActualIn

public CFGParameter getActualIn(int index)
Returns an argument node at the position in the actual-in list of this method entry.

Parameters:
index - The position where a parameter node is returned.
Returns:
The argument node at the position, null if there is no argument node found.

getActualOut

public CFGParameter getActualOut(int index)
Returns an argument node at the position in the actual-out list of this method entry.

Parameters:
index - The position where a parameter node is returned.
Returns:
The argument node at the position, null if there is no argument node found.

callSelf

protected boolean callSelf()
                    throws JxWrapperException
Tests if this method call recursively invokes the method itself.

Returns:
true if this method call recursively invokes the method itself.
Throws:
JxWrapperException - if the test fails.

print

public void print(java.lang.StringBuffer buf)
Collects information about this statement for printing.

Overrides:
print in class CFGStatement
Parameters:
buf - The information about the stetement.