public class AssignmentStatement extends Statement implements ExpressionStatement
This class represents an assignment statement in the storedprocedure language.
It extends the Statement
that could part of a Block
. This
statement holds references to the variable and it's value which could be an
Expression
or a Command
.
Statement.Labeled
LanguageObject.Util
TYPE_ASSIGNMENT, TYPE_BREAK, TYPE_COMMAND, TYPE_COMPOUND, TYPE_CONTINUE, TYPE_DECLARE, TYPE_ERROR, TYPE_IF, TYPE_LEAVE, TYPE_LOOP, TYPE_RETURN, TYPE_UNKNOWN, TYPE_UPDATE, TYPE_WHILE
Constructor and Description |
---|
AssignmentStatement()
Constructor for AssignmentStatement.
|
AssignmentStatement(ElementSymbol variable,
Command value)
Deprecated.
|
AssignmentStatement(ElementSymbol variable,
Expression value) |
AssignmentStatement(ElementSymbol variable,
QueryCommand value) |
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.
|
Object |
clone()
Deep clone statement to produce a new identical statement.
|
boolean |
equals(Object obj)
Compare two AssignmentStatements for equality.
|
Command |
getCommand()
Deprecated.
|
Class<?> |
getExpectedType() |
Expression |
getExpression() |
int |
getType()
Return the type for this statement, this is one of the types
defined on the statement object.
|
ElementSymbol |
getVariable()
Get the expression giving the value that is assigned to the variable.
|
int |
hashCode()
Get hashcode for AssignmentStatement.
|
void |
setCommand(Command command) |
void |
setExpression(Expression expression) |
void |
setVariable(ElementSymbol variable)
Set the variable that is assigned to the value
|
public AssignmentStatement()
public AssignmentStatement(ElementSymbol variable, QueryCommand value)
@Deprecated public AssignmentStatement(ElementSymbol variable, Command value)
public AssignmentStatement(ElementSymbol variable, Expression value)
@Deprecated public Command getCommand()
public void setCommand(Command command)
public Expression getExpression()
getExpression
in interface ExpressionStatement
public void setExpression(Expression expression)
setExpression
in interface ExpressionStatement
public ElementSymbol getVariable()
Expression
with the valuepublic void setVariable(ElementSymbol variable)
public int getType()
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
visitor
- Visitor being usedpublic Object clone()
clone
in interface LanguageObject
clone
in class Statement
public boolean equals(Object obj)
public int hashCode()
public Class<?> getExpectedType()
getExpectedType
in interface ExpressionStatement
Copyright © 2019. All rights reserved.