public class WhileStatement extends Statement implements Statement.Labeled
This class represents a while statement in the storedprocedure language.
It extends the Statement that could part of a block. This statement has
a block and a criteria that
determines when to exit the while loop.
Statement.LabeledLanguageObject.UtilTYPE_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 |
|---|
WhileStatement(Criteria criteria,
Block block)
Constructor for IfStatement.
|
| 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 WhileStatements for equality.
|
Block |
getBlock() |
Criteria |
getCondition()
Get the condition that determines which block needs to be executed.
|
String |
getLabel() |
int |
getType()
Return the type for this statement, this is one of the types
defined on the statement object.
|
int |
hashCode()
Get hashcode for WhileStatement.
|
void |
setBlock(Block block) |
void |
setCondition(Criteria criteria)
Set the condition that determines which block needs to be executed.
|
void |
setLabel(String label) |
public void setLabel(String label)
setLabel in interface Statement.Labeledpublic String getLabel()
getLabel in interface Statement.Labeledpublic Criteria getCondition()
Criteria to determine block executionpublic void setCondition(Criteria criteria)
criteria - The Criteria to determine block executionpublic Block getBlock()
public void setBlock(Block block)
block - public int getType()
public void acceptVisitor(LanguageVisitor visitor)
LanguageObjectacceptVisitor in interface LanguageObjectvisitor - Visitor being usedpublic Object clone()
clone in interface LanguageObjectclone in class Statementpublic boolean equals(Object obj)
Copyright © 2018 JBoss by Red Hat. All rights reserved.