org.teiid.query.sql.proc
Class LoopStatement

java.lang.Object
  extended by org.teiid.query.sql.proc.Statement
      extended by org.teiid.query.sql.proc.LoopStatement
All Implemented Interfaces:
java.lang.Cloneable, SubqueryContainer, LanguageObject

public class LoopStatement
extends Statement
implements SubqueryContainer

This class represents a loop statement in the storedprocedure language to cursor through a result set. It extends the Statement that could part of a block. This statement has a block, a select statement and a cursor. determines which block should be executed..


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
LoopStatement(Block block, Command query, java.lang.String cursorName)
           
 
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 LoopStatements for equality.
 Block getBlock()
           
 Command getCommand()
          Returns the subquery Command object
 java.lang.String getCursorName()
           
 int getType()
          Return the type for this statement, this is one of the types defined on the statement object.
 int hashCode()
          Get hashcode for LoopStatement.
 void setBlock(Block block)
           
 void setCommand(Command command)
          Sets the command.
 void setCommand(Query query)
           
 void setCursorName(java.lang.String cursorName)
           
 
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

LoopStatement

public LoopStatement(Block block,
                     Command query,
                     java.lang.String cursorName)
Method Detail

getCursorName

public java.lang.String getCursorName()
Returns:

getBlock

public Block getBlock()
Returns:

getCommand

public Command getCommand()
Description copied from interface: SubqueryContainer
Returns the subquery Command object

Specified by:
getCommand in interface SubqueryContainer
Returns:

setCommand

public void setCommand(Command command)
Sets the command.

Specified by:
setCommand in interface SubqueryContainer
Parameters:
command - the subquery Command object

setCursorName

public void setCursorName(java.lang.String cursorName)
Parameters:
string -

setBlock

public void setBlock(Block block)
Parameters:
block -

setCommand

public void setCommand(Query query)
Parameters:
query -

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 statement type

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 LoopStatements for equality. They will only evaluate to equal if they are IDENTICAL: the blocks is same, the query is same, and the cursor name is same.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object
Returns:
True if equal

hashCode

public int hashCode()
Get hashcode for LoopStatement. WARNING: This hash code relies on the hash codes of the block and the query on this statement. Hash code is only valid after the block has been completely constructed.

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


Copyright © 2011. All Rights Reserved.