com.metamatrix.query.processor.program
Class Program

java.lang.Object
  extended by com.metamatrix.query.processor.program.Program
All Implemented Interfaces:
Describable, java.lang.Cloneable

public class Program
extends java.lang.Object
implements java.lang.Cloneable, Describable

A program is a sequence of ProgramInstruction. Certain ProgramInstructions, such as IfInstruction and WhileInstruction may have pointers to sub programs.


Field Summary
 
Fields inherited from interface com.metamatrix.query.processor.Describable
PROP_BINDINGS, PROP_CHILDREN, PROP_CONDITIONS, PROP_CRITERIA, PROP_DATA_COL, PROP_DEFAULT, PROP_DEFAULT_PROGRAM, PROP_ELSE, PROP_ENCODING, PROP_EXECUTION_PLAN, PROP_EXPRESSION, PROP_FORMATTED, PROP_GROUP, PROP_GROUP_COLS, PROP_IN_MEMORY, PROP_INTO_GROUP, PROP_IS_STAGING, PROP_JOIN_CRITERIA, PROP_JOIN_STRATEGY, PROP_JOIN_TYPE, PROP_MESSAGE, PROP_MODEL_NAME, PROP_NAMESPACE, PROP_NAMESPACE_DECL, PROP_NODE_COST_ESTIMATES, PROP_NODE_STATS_LIST, PROP_NODE_STATS_PROPS, PROP_OPTIONAL, PROP_OUTPUT_COLS, PROP_PROGRAM, PROP_PROGRAMS, PROP_RECURSE_DIR, PROP_REMOVE_DUPS, PROP_RESULT_SET, PROP_ROW_LIMIT, PROP_ROW_OFFSET, PROP_SELECT_COLS, PROP_SORT_COLS, PROP_SQL, PROP_TAG, PROP_THEN, PROP_TYPE, PROP_VARIABLE
 
Constructor Summary
Program()
          Constructor for Program.
 
Method Summary
 void addInstruction(ProgramInstruction instruction)
           
 void addInstructions(Program instructions)
           
 java.lang.Object clone()
          Produces a deep clone.
 void decrementProgramCounter()
          Decrements the program counter, so that the next call to getCurrentInstruction() will return the previous instruction.
 java.util.Collection getChildPlans()
          Finds all nested plans and returns them.
 ProgramInstruction getCurrentInstruction()
          Returns the next instruction to be executed, or null if there are none or no more instructions.
 java.util.Map getDescriptionProperties()
          Get a description as a set of properties of primitive types such as String, Integer, etc.
 ProgramInstruction getInstructionAt(int instructionIndex)
          Returns the instruction to be executed at the indicated index, or null if there is no instruction at that index.
 java.util.List getProcessorInstructions()
           
 void incrementProgramCounter()
          Increments the program counter, so that the next call to getCurrentInstruction() will return the following instruction.
 void resetProgramCounter()
          Resets this program, so it can be run through again.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Program

public Program()
Constructor for Program.

Method Detail

getCurrentInstruction

public ProgramInstruction getCurrentInstruction()
Returns the next instruction to be executed, or null if there are none or no more instructions.

Returns:
ProgramInstruction to be executed next, or null if there are no more to execute (or if this Program is empty)

incrementProgramCounter

public void incrementProgramCounter()
Increments the program counter, so that the next call to getCurrentInstruction() will return the following instruction. This method is intended to be used by a ProcessingInstruction itself, to control the flow of execution.


decrementProgramCounter

public void decrementProgramCounter()
Decrements the program counter, so that the next call to getCurrentInstruction() will return the previous instruction. This method is intended to be used by a ProcessingInstruction itself, to control the flow of execution.


resetProgramCounter

public void resetProgramCounter()
Resets this program, so it can be run through again.


getInstructionAt

public ProgramInstruction getInstructionAt(int instructionIndex)
Returns the instruction to be executed at the indicated index, or null if there is no instruction at that index.

Returns:
instruction to be executed at the indicated index, or null if there is no instruction at that index.

addInstruction

public void addInstruction(ProgramInstruction instruction)

addInstructions

public void addInstructions(Program instructions)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Produces a deep clone.

Overrides:
clone in class java.lang.Object

getDescriptionProperties

public java.util.Map getDescriptionProperties()
Description copied from interface: Describable
Get a description as a set of properties of primitive types such as String, Integer, etc.

Specified by:
getDescriptionProperties in interface Describable
Returns:
Map of properties

getChildPlans

public java.util.Collection getChildPlans()
Finds all nested plans and returns them.

Returns:
List of ProcessorPlan
Since:
4.2

getProcessorInstructions

public java.util.List getProcessorInstructions()


Copyright © 2009. All Rights Reserved.