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
MethodInvocationNode
s that correspond to no AST Tree
, in which
case, the tree field will be null.-
Field Summary
Modifier and TypeFieldDescriptionThe arguments of the method invocation.protected @Nullable EnhancedForLoopTree
If this MethodInvocationNode is a node for anIterator.next()
desugared from an enhanced for loop, then theenhancedForLoop
field is theEnhancedForLoopTree
AST node.protected @Nullable ExpressionTree
If this MethodInvocationNode is a node for anIterator.next()
desugared from an enhanced for loop, then theiterExpression
field is the expression in the for loop, e.g.,iter
infor(Object o: iter
.protected final MethodAccessNode
The MethodAccessNode for the method being invoked.protected final @Nullable MethodInvocationTree
The tree for the method invocation.protected final TreePath
The tree path to the method invocation. -
Constructor Summary
ConstructorDescriptionMethodInvocationNode
(@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.boolean
getArgument
(int i) If this MethodInvocationNode is a node for anIterator.next()
desugared from an enhanced for loop, then return the correspondingEnhancedForLoopTree
AST node.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.,iter
infor(Object o: iter
.getTree()
Returns theTree
in the abstract syntax tree, ornull
if no corresponding tree exists.int
hashCode()
void
setEnhancedForLoop
(@Nullable EnhancedForLoopTree enhancedForLoop) Set the enhanced for loop for whichthis
is the desugared loop update.void
setIterableExpression
(@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, toStringDebug
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 theiterExpression
field is the expression in the for loop, e.g.,iter
infor(Object o: iter
.Is set by
setIterableExpression(com.sun.source.tree.ExpressionTree)
. -
enhancedForLoop
If this MethodInvocationNode is a node for anIterator.next()
desugared from an enhanced for loop, then theenhancedForLoop
field is theEnhancedForLoopTree
AST node.Is set by
setEnhancedForLoop(com.sun.source.tree.EnhancedForLoopTree)
.
-
-
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.,iter
infor(Object o: iter
. Otherwise, return null.- Returns:
- the iter expression, or null if this is not a
Iterator.next()
from an enhanced for loop
-
getEnhancedForLoop
If this MethodInvocationNode is a node for anIterator.next()
desugared from an enhanced for loop, then return the correspondingEnhancedForLoopTree
AST node. Otherwise, return null.- Returns:
- the
EnhancedForLoopTree
, or null if this is not aIterator.next()
from an enhanced for loop
-
setIterableExpression
Set the iterable expression from a for loop.- Parameters:
iterableExpression
- iterable expression- See Also:
-
setEnhancedForLoop
Set the enhanced for loop for whichthis
is the desugared loop update.- Parameters:
enhancedForLoop
- theEnhancedForLoopTree
- See Also:
-
getTree
Description copied from class:Node
Returns theTree
in the abstract syntax tree, ornull
if no corresponding tree exists. For instance, this is the case for anImplicitThisNode
. -
accept
Description copied from class:Node
Accept method of the visitor pattern. -
toString
-
equals
-
hashCode
public int hashCode() -
getOperands
Description copied from class:Node
- Specified by:
getOperands
in classNode
- Returns:
- a collection containing all of the operand
Node
s of thisNode
-