|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.query.processor.program.ProgramInstruction
com.metamatrix.query.processor.proc.IfInstruction
public class IfInstruction
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
.
Field Summary |
---|
Constructor Summary | |
---|---|
IfInstruction(Criteria condition,
Program ifProgram)
Constructor for IfInstruction. |
|
IfInstruction(Criteria condition,
Program ifProgram,
Program elseProgram)
Constructor for IfInstruction. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a deep clone |
java.util.Collection |
getChildPlans()
Finds all nested plans and returns them. |
java.util.Map |
getDescriptionProperties()
Get a description as a set of properties of primitive types such as String, Integer, etc. |
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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 IfInstruction(Criteria condition, Program ifProgram)
condition
- The Criteria
used to determine which block to executeifProgram
- The Program
representing the "if" blockMethod Detail |
---|
public void process(ProcedurePlan procEnv) throws BlockedException, MetaMatrixComponentException, MetaMatrixProcessingException
process
in class ProgramInstruction
MetaMatrixProcessingException
BlockedException
MetaMatrixComponentException
ProgramInstruction.process(ProcedurePlan)
public Program getIfProgram()
public Program getElseProgram()
public java.lang.Object clone()
clone
in class ProgramInstruction
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map getDescriptionProperties()
Describable
getDescriptionProperties
in interface Describable
getDescriptionProperties
in class ProgramInstruction
public java.util.Collection getChildPlans()
ProgramInstruction
getChildPlans
in class ProgramInstruction
ProgramInstruction.getChildPlans()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |