Package org.teiid.query.sql.proc
Class AssignmentStatement
- java.lang.Object
-
- org.teiid.query.sql.proc.Statement
-
- org.teiid.query.sql.proc.AssignmentStatement
-
- All Implemented Interfaces:
Cloneable
,LanguageObject
,ExpressionStatement
- Direct Known Subclasses:
DeclareStatement
,ReturnStatement
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 aBlock
. This statement holds references to the variable and it's value which could be anExpression
or aCommand
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.teiid.query.sql.proc.Statement
Statement.Labeled
-
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject
LanguageObject.Util
-
-
Field Summary
-
Fields inherited from class org.teiid.query.sql.proc.Statement
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 Summary
Constructors Constructor Description AssignmentStatement()
Constructor for AssignmentStatement.AssignmentStatement(ElementSymbol variable, Command value)
Deprecated.AssignmentStatement(ElementSymbol variable, QueryCommand value)
AssignmentStatement(ElementSymbol variable, Expression value)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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
-
-
-
Constructor Detail
-
AssignmentStatement
public AssignmentStatement()
Constructor for AssignmentStatement.
-
AssignmentStatement
public AssignmentStatement(ElementSymbol variable, QueryCommand value)
-
AssignmentStatement
@Deprecated public AssignmentStatement(ElementSymbol variable, Command value)
Deprecated.
-
AssignmentStatement
public AssignmentStatement(ElementSymbol variable, Expression value)
-
-
Method Detail
-
getCommand
@Deprecated public Command getCommand()
Deprecated.
-
setCommand
public void setCommand(Command command)
-
getExpression
public Expression getExpression()
- Specified by:
getExpression
in interfaceExpressionStatement
-
setExpression
public void setExpression(Expression expression)
- Specified by:
setExpression
in interfaceExpressionStatement
-
getVariable
public ElementSymbol getVariable()
Get the expression giving the value that is assigned to the variable.- Returns:
- An
Expression
with the value
-
setVariable
public void setVariable(ElementSymbol variable)
Set the variable that is assigned to the value- Parameters:
variable
-ElementSymbol
that is being assigned
-
getType
public int getType()
Return the type for this statement, this is one of the types defined on the statement object.
-
acceptVisitor
public void acceptVisitor(LanguageVisitor visitor)
Description copied from interface:LanguageObject
Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.- Specified by:
acceptVisitor
in interfaceLanguageObject
- Parameters:
visitor
- Visitor being used
-
clone
public Object clone()
Deep clone statement to produce a new identical statement.- Specified by:
clone
in interfaceLanguageObject
- Specified by:
clone
in classStatement
- Returns:
- Deep clone
-
equals
public boolean equals(Object obj)
Compare two AssignmentStatements for equality. They will only evaluate to equal if they are IDENTICAL: variable and its value which could be a command or an expression objects are equal.
-
hashCode
public int hashCode()
Get hashcode for AssignmentStatement. WARNING: This hash code relies on the hash codes of the variable and its value which could be a command or an expression.
-
getExpectedType
public Class<?> getExpectedType()
- Specified by:
getExpectedType
in interfaceExpressionStatement
-
-