com.metamatrix.query.processor.program
Class ProgramInstruction

java.lang.Object
  extended by com.metamatrix.query.processor.program.ProgramInstruction
All Implemented Interfaces:
Describable, java.lang.Cloneable
Direct Known Subclasses:
AbstractAssignmentInstruction, ContinueInstruction, CreateCursorResultSetInstruction, ExecDynamicSqlInstruction, ExecSqlInstruction, IfInstruction, WhileInstruction

public abstract class ProgramInstruction
extends java.lang.Object
implements java.lang.Cloneable, Describable

Abstract superclass of all program instructions.

All processor instructions need to be cloneable, but it most cases the default Object.clone operation will suffice, since in most cases the processing instructions will be stateless, or the state will be immutable. The exception to this are instructions that have sub programs in them - those sub programs need to be cloned.


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
ProgramInstruction()
           
 
Method Summary
 java.lang.Object clone()
          Override Object.clone() to make the method public.
 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.
abstract  void process(ProcedurePlan env)
          Allow this instruction to do whatever processing it needs, and to in turn manipulate the running program, (via the ProcessorEnvironment getProgramStack method.) A typical instruction should simply increment the program counter of the current program, but specialized instructions may add sub programs to the stack or not increment the counter (so that they are executed again.)
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgramInstruction

public ProgramInstruction()
Method Detail

process

public abstract void process(ProcedurePlan env)
                      throws MetaMatrixComponentException,
                             MetaMatrixProcessingException
Allow this instruction to do whatever processing it needs, and to in turn manipulate the running program, (via the ProcessorEnvironment getProgramStack method.) A typical instruction should simply increment the program counter of the current program, but specialized instructions may add sub programs to the stack or not increment the counter (so that they are executed again.)

Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

getChildPlans

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

Returns:
List of ProcessorPlan
Since:
4.2

clone

public java.lang.Object clone()
Override Object.clone() to make the method public. This method simply calls super.clone(), deferring to the default shallow cloning. Some ProcessorInstruction subclasses may need to override with custom safe or deep cloning.

Overrides:
clone in class java.lang.Object
Returns:
shallow clone

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


Copyright © 2009. All Rights Reserved.