public class MethodCallStatement extends JavaStatement implements StatementContainer, ExpressionContainer
ProgramElement.TreeStructureSourceElement.Position| Modifier and Type | Field and Description |
|---|---|
protected Statement |
body
Body.
|
protected ExecutionContext |
ec |
protected Expression |
resultVar
resultVar (should be a VariableReference, but the parser can't enforce this)
|
private static long |
serialVersionUID |
parentcommentsfactorySTRUCTURAL_EQUALITY, STRUCTURAL_HASH_CODE| Modifier | Constructor and Description |
|---|---|
|
MethodCallStatement(Expression resultVar,
ExecutionContext ec,
StatementBlock body)
MethodCallStatement.
|
protected |
MethodCallStatement(MethodCallStatement proto)
MethodCallStatement.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(SourceVisitor v) |
MethodCallStatement |
deepClone()
Deep clone.
|
Statement |
getBody()
Get body.
|
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
child array
|
int |
getChildCount()
Returns the number of children of this node.
|
int |
getChildPositionCode(ProgramElement child) |
ExecutionContext |
getExecutionContext()
returns the execution context
|
Expression |
getExpressionAt(int index)
Return the expression at the specified index in this node's
"virtual" expression array.
|
int |
getExpressionCount()
Get the number of expressions in this container.
|
SourceElement |
getFirstElement()
Finds the source element that occurs first in the source.
|
SourceElement |
getLastElement()
Finds the source element that occurs last in the source.
|
Expression |
getResultVariable()
Get the result variable.
|
Statement |
getStatementAt(int index)
Return the statement at the specified index in this node's
"virtual" statement array.
|
int |
getStatementCount()
Get the number of statements in this container.
|
void |
makeParentRoleValid()
Ensures that each child has "this" as syntactical parent.
|
boolean |
replaceChild(ProgramElement p,
ProgramElement q)
Replace a single child in the current node.
|
void |
setBody(Statement body)
Set body.
|
void |
setResultVariable(Expression resultVar)
Set the result variable.
|
getASTParent, getStatementContainer, setStatementContainergetIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAllgetComments, setComments, validategetEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndexOfChild, getIndexOfChild, getRoleOfChild, makeAllParentRolesValid, validateAllgetASTParent, getComments, setCommentsgetEndPosition, getFactory, getRelativePosition, getStartPosition, setEndPosition, setRelativePosition, setStartPosition, toSourcevalidateprivate static final long serialVersionUID
protected Expression resultVar
protected ExecutionContext ec
protected Statement body
public MethodCallStatement(Expression resultVar, ExecutionContext ec, StatementBlock body)
resultVar - the ProgramVariable the return value is assigned tobody - a Statement containing the method body of
the called methodprotected MethodCallStatement(MethodCallStatement proto)
proto - a MethodCallStatementpublic void setResultVariable(Expression resultVar)
resultVar - the result variablepublic Expression getResultVariable()
public void setBody(Statement body)
body - the Statementpublic Statement getBody()
public SourceElement getFirstElement()
getFirstElement in interface SourceElementgetFirstElement in class JavaSourceElementpublic SourceElement getLastElement()
getLastElement in interface SourceElementgetLastElement in class JavaSourceElementpublic ExecutionContext getExecutionContext()
public int getChildCount()
getChildCount in interface NonTerminalProgramElementpublic ProgramElement getChildAt(int index)
getChildAt in interface NonTerminalProgramElementindex - an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException - if index is out
of boundspublic int getChildPositionCode(ProgramElement child)
getChildPositionCode in interface NonTerminalProgramElementpublic int getStatementCount()
getStatementCount in interface StatementContainerpublic Statement getStatementAt(int index)
getStatementAt in interface StatementContainerindex - an index for a statement.java.lang.ArrayIndexOutOfBoundsException - if index is out
of bounds.public int getExpressionCount()
getExpressionCount in interface ExpressionContainerpublic Expression getExpressionAt(int index)
getExpressionAt in interface ExpressionContainerindex - an index for a expression.java.lang.ArrayIndexOutOfBoundsException - if index is out
of bounds.public boolean replaceChild(ProgramElement p, ProgramElement q)
replaceChild in interface NonTerminalProgramElementp - the old child.q - the new child.java.lang.ClassCastException - if the new child cannot take over
the role of the old one.public void makeParentRoleValid()
makeParentRoleValid in interface NonTerminalProgramElementmakeParentRoleValid in class JavaNonTerminalProgramElementpublic void accept(SourceVisitor v)
accept in interface SourceElementpublic MethodCallStatement deepClone()
deepClone in interface SourceElementdeepClone in interface Statement