|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.query.sql.proc.Statement
com.metamatrix.query.sql.proc.IfStatement
public class IfStatement
This class represents an if-else statement in the storedprocedure language.
It extends the Statement
that could part of a block. This statement has
an IF block and an optional ELSE block, it also holds reference to the criteria that
determines which block should be executed..
Field Summary |
---|
Fields inherited from class com.metamatrix.query.sql.proc.Statement |
---|
TYPE_ASSIGNMENT, TYPE_BREAK, TYPE_COMMAND, TYPE_CONTINUE, TYPE_DECLARE, TYPE_ERROR, TYPE_IF, TYPE_LOOP, TYPE_UNKNOWN, TYPE_WHILE |
Constructor Summary | |
---|---|
IfStatement()
Constructor for IfStatement. |
|
IfStatement(Criteria criteria,
Block ifBlock)
Constructor for IfStatement. |
|
IfStatement(Criteria criteria,
Block ifBlock,
Block elseBlock)
Constructor for IfStatement. |
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 IfStatements for equality. |
Criteria |
getCondition()
Get the condition that determines which block needs to be executed. |
Block |
getElseBlock()
Get the statement's ELSE block. |
Block |
getIfBlock()
Get the statement's IF block. |
int |
getType()
Return the type for this statement, this is one of the types defined on the statement object. |
boolean |
hasElseBlock()
Return a boolean indicating if the statement has an else block. |
int |
hashCode()
Get hashcode for IfStatement. |
void |
setCondition(Criteria criteria)
Set the condition that determines which block needs to be executed. |
void |
setElseBlock(Block block)
Set the statement's ELSE block. |
void |
setIfBlock(Block block)
Set the statement's IF block. |
java.lang.String |
toString()
Returns a string representation of an instance of this class. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IfStatement()
public IfStatement(Criteria criteria, Block ifBlock, Block elseBlock)
criteria
- The criteria determining which bleck should be executedifBlock
- The IF Block
object.ifBlock
- The ELSE Block
object.public IfStatement(Criteria criteria, Block ifBlock)
criteria
- The criteria determining which bleck should be executedifBlock
- The IF Block
object.Method Detail |
---|
public Block getIfBlock()
Block
object.public void setIfBlock(Block block)
block
- The IF Block
object.public Block getElseBlock()
Block
object.public void setElseBlock(Block block)
block
- The ELSE Block
object.public boolean hasElseBlock()
public Criteria getCondition()
Criteria
to determine block executionpublic void setCondition(Criteria criteria)
criteria
- The Criteria
to determine block executionpublic int getType()
getType
in class Statement
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
visitor
- Visitor being usedpublic java.lang.Object clone()
clone
in interface LanguageObject
clone
in class Statement
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Other object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |