public class Call extends Statement implements IExpression
This AST element represents a call to a method.
Example: foo(0, 1, "bar")
Method
Modifier and Type | Method and Description |
---|---|
static Call |
build(Method m,
boolean is_super,
java.util.List<IExpression> arguments)
Create a call element.
|
java.util.List<IExpression> |
getArguments()
Retrieve the list of arguments passed to the method.
|
Method |
getMethod()
Get the method element.
|
void |
insertArgument(int index,
IExpression arg)
Insert an argument to the list of arguments.
|
boolean |
isSuperCall()
Determine if the call is a call to a super-class method.
|
IExpression |
removeArgument(int index)
Pull an argument from the list of arguments.
|
void |
setMethod(Method method,
boolean is_super)
Set the method to be called.
|
attachTag, getSubElements, isCompound, replaceSubElement, retrieveTag
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attachTag, getSubElements, replaceSubElement, retrieveTag
public static Call build(Method m, boolean is_super, java.util.List<IExpression> arguments)
Create a call element.
m
- mandatory methodis_super
- true if the call is a call to a super-class method (super.foo(...)
)arguments
- mandatory list of arguments, provide an empty list if there is nonepublic Method getMethod()
Get the method element.
public void setMethod(Method method, boolean is_super)
Set the method to be called.
method
- mandatory methodis_super
- indicates if the method being called is a super-class methodpublic boolean isSuperCall()
Determine if the call is a call to a super-class method.
public java.util.List<IExpression> getArguments()
Retrieve the list of arguments passed to the method.
If the method being called is a virtual method, the first argument will be an expression representing the object on which this method is called.
public void insertArgument(int index, IExpression arg)
Insert an argument to the list of arguments.
index
- 0-based argument indexarg
- mandatory argument to be insertedpublic IExpression removeArgument(int index)
Pull an argument from the list of arguments.
index
- 0-based argument index