public class IfInstruction extends ProgramInstruction
This instruction an holds an if block and an else block and a criteria that determines
which block will be executed. These blocks are Program
objects that could contain
nested if-else block. Therefore, this ProgramInstruction
implements an arbitrarily deep if-else if-....else block.
During processing, the Criteria is evaluated and if it evaluates to true,
the "if" block is executed else the "else" block if there is one is executed. These
programs are placed on the stack
.
Constructor and Description |
---|
IfInstruction(Criteria condition,
Program ifProgram)
Constructor for IfInstruction.
|
IfInstruction(Criteria condition,
Program ifProgram,
Program elseProgram)
Constructor for IfInstruction.
|
Modifier and Type | Method and Description |
---|---|
IfInstruction |
clone()
Returns a deep clone
|
PlanNode |
getDescriptionProperties() |
Program |
getElseProgram() |
Program |
getIfProgram() |
void |
process(ProcedurePlan procEnv)
This instruction will evaluate it's criteria, if it evaluates
to true, it will push the corresponding sub Program on to the top of the
program stack, and break from the loop.
|
Boolean |
requiresTransaction(boolean transactionalReads) |
String |
toString() |
public IfInstruction(Criteria condition, Program ifProgram, Program elseProgram)
condition
- The Criteria
used to determine which block to executeifProgram
- The Program
representing the "if" blockelseProgram
- The Program
representing the "else" blockpublic void process(ProcedurePlan procEnv) throws BlockedException, TeiidComponentException, TeiidProcessingException
process
in class ProgramInstruction
TeiidProcessingException
BlockedException
TeiidComponentException
ProgramInstruction.process(ProcedurePlan)
public Program getIfProgram()
public Program getElseProgram()
public IfInstruction clone()
clone
in class ProgramInstruction
public PlanNode getDescriptionProperties()
getDescriptionProperties
in class ProgramInstruction
public Boolean requiresTransaction(boolean transactionalReads)
requiresTransaction
in class ProgramInstruction
Copyright © 2019. All rights reserved.