org.teiid.query.sql.proc
Class AssignmentStatement

java.lang.Object
  extended by org.teiid.query.sql.proc.Statement
      extended by org.teiid.query.sql.proc.AssignmentStatement
All Implemented Interfaces:
java.lang.Cloneable, LanguageObject, ExpressionStatement
Direct Known Subclasses:
DeclareStatement

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.


Nested Class Summary
 
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_CONTINUE, TYPE_DECLARE, TYPE_ERROR, TYPE_IF, TYPE_LOOP, TYPE_UNKNOWN, TYPE_UPDATE, TYPE_WHILE
 
Constructor Summary
AssignmentStatement()
          Constructor for AssignmentStatement.
AssignmentStatement(ElementSymbol variable, Command value)
          Deprecated. 
AssignmentStatement(ElementSymbol variable, Expression value)
           
AssignmentStatement(ElementSymbol variable, QueryCommand value)
           
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 java.lang.Object clone()
          Deep clone statement to produce a new identical statement.
 boolean equals(java.lang.Object obj)
          Compare two AssignmentStatements for equality.
 Command getCommand()
          Deprecated. 
 java.lang.Class<?> getExpectedType()
           
 Expression getExpression()
           
 int getType()
          Return the type for this statement, this is one of the types defined on the statement object.
 Expression getValue()
          Deprecated. 
 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 setValue(Expression value)
          Deprecated. 
 void setVariable(ElementSymbol variable)
          Set the variable that is assigned to the value
 
Methods inherited from class org.teiid.query.sql.proc.Statement
toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

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)

getValue

@Deprecated
public Expression getValue()
Deprecated. 

See Also:
getExpression()

setValue

@Deprecated
public void setValue(Expression value)
Deprecated. 

See Also:
setExpression(Expression)

getExpression

public Expression getExpression()
Specified by:
getExpression in interface ExpressionStatement

setExpression

public void setExpression(Expression expression)
Specified by:
setExpression in interface ExpressionStatement

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


getType

public int getType()
Return the type for this statement, this is one of the types defined on the statement object.

Specified by:
getType in class Statement
Returns:
The type of this statement

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 interface LanguageObject
Parameters:
visitor - Visitor being used

clone

public java.lang.Object clone()
Deep clone statement to produce a new identical statement.

Specified by:
clone in interface LanguageObject
Specified by:
clone in class Statement
Returns:
Deep clone

equals

public boolean equals(java.lang.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.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object
Returns:
True if 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.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

getExpectedType

public java.lang.Class<?> getExpectedType()
Specified by:
getExpectedType in interface ExpressionStatement


Copyright © 2010. All Rights Reserved.