Class MethodInvocationNode
java.lang.Object
org.checkerframework.dataflow.cfg.node.Node
org.checkerframework.dataflow.cfg.node.MethodInvocationNode
- All Implemented Interfaces:
org.plumelib.util.UniqueId
A node for method invocation.
target(arg1, arg2, ...)CFGs may contain
MethodInvocationNodes that correspond to no AST Tree, in which
case, the tree field will be null.-
Field Summary
FieldsModifier and TypeFieldDescriptionThe arguments of the method invocation.protected @Nullable ExpressionTreeIf this MethodInvocationNode is a node for anIterator.next()desugared from an enhanced for loop, then theiterExpressionfield is the expression in the for loop, e.g.,iterinfor(Object o: iter.protected final MethodAccessNodeThe MethodAccessNode for the method being invoked.protected final @Nullable MethodInvocationTreeThe tree for the method invocation.protected final TreePathThe tree path to the method invocation. -
Constructor Summary
ConstructorsConstructorDescriptionMethodInvocationNode(@Nullable MethodInvocationTree tree, MethodAccessNode target, List<Node> arguments, TreePath treePath) Create a MethodInvocationNode.MethodInvocationNode(MethodAccessNode target, List<Node> arguments, TreePath treePath) -
Method Summary
Modifier and TypeMethodDescription<R,P> R accept(NodeVisitor<R, P> visitor, P p) Accept method of the visitor pattern.booleangetArgument(int i) If this MethodInvocationNode is a node for anIterator.next()desugared from an enhanced for loop, then return the expression in the for loop, e.g.,iterinfor(Object o: iter.getTree()Returns theTreein the abstract syntax tree, ornullif no corresponding tree exists.inthashCode()voidsetIterableExpression(@Nullable ExpressionTree iterableExpression) Set the iterable expression from a for loop.toString()Methods inherited from class org.checkerframework.dataflow.cfg.node.Node
getBlock, getInSource, getTransitiveOperands, getType, getUid, isLValue, nodeCollectionToString, setBlock, setInSource, setLValue, toStringDebugMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.plumelib.util.UniqueId
getClassAndUid
-
Field Details
-
tree
The tree for the method invocation. -
target
The MethodAccessNode for the method being invoked. Includes the receiver if any. For a static method, the receiver may be a class name. -
arguments
The arguments of the method invocation. -
treePath
The tree path to the method invocation. -
iterableExpression
If this MethodInvocationNode is a node for anIterator.next()desugared from an enhanced for loop, then theiterExpressionfield is the expression in the for loop, e.g.,iterinfor(Object o: iter.Is set by
setIterableExpression(com.sun.source.tree.ExpressionTree).
-
-
Constructor Details
-
MethodInvocationNode
public MethodInvocationNode(@Nullable MethodInvocationTree tree, MethodAccessNode target, List<Node> arguments, TreePath treePath) Create a MethodInvocationNode.- Parameters:
tree- for the method invocationtarget- the MethodAccessNode for the method being invokedarguments- arguments of the method invocationtreePath- path to the method invocation
-
MethodInvocationNode
-
-
Method Details
-
getTarget
-
getArguments
-
getArgument
-
getTreePath
-
getIterableExpression
If this MethodInvocationNode is a node for anIterator.next()desugared from an enhanced for loop, then return the expression in the for loop, e.g.,iterinfor(Object o: iter. Otherwise, return null.- Returns:
- the iter expression, or null if this is not a
Iterator.next()from an enhanced for loop
-
setIterableExpression
Set the iterable expression from a for loop.- Parameters:
iterableExpression- iterable expression- See Also:
-
getTree
Description copied from class:NodeReturns theTreein the abstract syntax tree, ornullif no corresponding tree exists. For instance, this is the case for anImplicitThisNode. -
accept
Description copied from class:NodeAccept method of the visitor pattern. -
toString
-
equals
-
hashCode
public int hashCode() -
getOperands
Description copied from class:Node- Specified by:
getOperandsin classNode- Returns:
- a collection containing all of the operand
Nodes of thisNode
-