org.jtool.jxplatform.graph.pdg
Class PDGStatement

java.lang.Object
  extended byorg.jtool.jxplatform.graph.GraphNode
      extended byorg.jtool.jxplatform.graph.pdg.PDGNode
          extended byorg.jtool.jxplatform.graph.pdg.PDGStatement
All Implemented Interfaces:
GraphElement, GraphNodeSort

public class PDGStatement
extends PDGNode

A statement node of PDGs.

Author:
Katsuhsa Maruyama

Field Summary
 
Fields inherited from class org.jtool.jxplatform.graph.pdg.PDGNode
cfgnode
 
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 PDGStatement()
          Creates a new, empty object.
protected PDGStatement(CFGStatement node)
          Creates a new node.
 
Method Summary
 boolean definesVariable(JxVariable jv)
          Tests if this statement defines a variable.
 JxVariable getDefinedVariable(java.lang.String name)
          Returns a defined variable with a name at this statement.
 JxVariableList getDefinedVariables()
          Returns variables defined at this statement.
 JxVariable getUsedVariable(java.lang.String name)
          Returns a defined variable with a name at this statement.
 JxVariableList getUsedVariables()
          Returns variables used at this statement.
 boolean isStatement()
          Tests if this node indicates a statement node.
 void print(java.lang.StringBuffer buf)
          Collects information about this statement for printing.
 boolean usesVariable(JxVariable jv)
          Tests if this statement uses a variable.
 
Methods inherited from class org.jtool.jxplatform.graph.pdg.PDGNode
getCFGNode, getDefId, getIncomingCDEdges, getIncomingDDEdges, getOutgoingCDEdges, getOutgoingDDEdges, isBranchSt, isDominated, isFalseDominated, isLoopSt, isTrueDominated, print, print, write
 
Methods inherited from class org.jtool.jxplatform.graph.GraphNode
addIncomingEdge, addIncomingEdges, addOutgoingEdge, addOutgoingEdges, clear, clearId, clearIncomingEdges, clearOutgoingEdges, equals, 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

PDGStatement

protected PDGStatement()
Creates a new, empty object.


PDGStatement

protected PDGStatement(CFGStatement node)
Creates a new node.

Parameters:
node - A CFG node correspoinding to this node.
Method Detail

isStatement

public boolean isStatement()
Tests if this node indicates a statement node.

Overrides:
isStatement in class PDGNode
Returns:
always true.

getDefinedVariables

public JxVariableList getDefinedVariables()
Returns variables defined at this statement.

Returns:
The colelction of variables defined at this statement.
See Also:
CFGStatement.getDefinedVariables()

getUsedVariables

public JxVariableList getUsedVariables()
Returns variables used at this statement.

Returns:
The colelction of variables used at this statement.
See Also:
CFGStatement.getUsedVariables()

definesVariable

public boolean definesVariable(JxVariable jv)
Tests if this statement defines a variable.

Parameters:
jv - A variable wrapper to be tested.
Returns:
true if this statement defines the variable, otherwise false.
See Also:
CFGStatement.definesVariable(JxVariable)

usesVariable

public boolean usesVariable(JxVariable jv)
Tests if this statement uses a variable.

Parameters:
jv - A variable wrapper to be tested.
Returns:
true if this statement uses the variable, otherwise false.
See Also:
CFGStatement.usesVariable(JxVariable)

getDefinedVariable

public JxVariable getDefinedVariable(java.lang.String name)
Returns a defined variable with a name at this statement.

Parameters:
name - The name of a variable to be retrieved.
Returns:
The variable wrapper, or null if there is no variable found.
See Also:
CFGStatement.getDefinedVariable(String)

getUsedVariable

public JxVariable getUsedVariable(java.lang.String name)
Returns a defined variable with a name at this statement.

Parameters:
name - The name of a variable to be retrieved.
Returns:
The variable wrapper, or null if there is no variable found.
See Also:
CFGStatement.getUsedVariable(String)

print

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

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