com.metamatrix.query.processor.proc
Class AbstractAssignmentInstruction

java.lang.Object
  extended by com.metamatrix.query.processor.program.ProgramInstruction
      extended by com.metamatrix.query.processor.proc.CommandInstruction
          extended by com.metamatrix.query.processor.proc.AbstractAssignmentInstruction
All Implemented Interfaces:
Describable, java.lang.Cloneable
Direct Known Subclasses:
AssignmentInstruction, ErrorInstruction

public abstract class AbstractAssignmentInstruction
extends CommandInstruction

This instruction updates the current variable context with a value for the Variable defined using a DeclareInstruction, the variable value is obtained by either processing a expression or a command(stored as a processplan). The Processing of the command is expected to result in 1 column, 1 row tuple.


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
AbstractAssignmentInstruction()
           
 
Method Summary
protected  void cloneState(AbstractAssignmentInstruction 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.
protected abstract  void getDescriptionProperties(java.util.Map props)
           
 Expression getExpression()
           
protected  ProcessorPlan getProcessorPlan()
           
 ProcessorPlan getProcessPlan()
           
 ElementSymbol getVariable()
           
 void process(ProgramEnvironment env)
           Updates the current variable context with a value for the Variable defined using a DeclareInstruction, the variable value is obtained by either processing a expression or a command(stored as a processplan).
protected abstract  void processValue(java.lang.Object value, VariableContext varContext)
           
 void setExpression(Expression expression)
           
 void setProcessPlan(ProcessorPlan processPlan)
           
 void setVariable(ElementSymbol variable)
           
 
Methods inherited from class com.metamatrix.query.processor.proc.CommandInstruction
cloneReferences, getReferences, setReferences
 
Methods inherited from class com.metamatrix.query.processor.program.ProgramInstruction
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAssignmentInstruction

public AbstractAssignmentInstruction()
Method Detail

process

public void process(ProgramEnvironment env)
             throws BlockedException,
                    MetaMatrixComponentException,
                    MetaMatrixProcessingException

Updates the current variable context with a value for the Variable defined using a DeclareInstruction, the variable value is obtained by either processing a expression or a command(stored as a processplan). The Processing of the command is expected to result in 1 column, 1 row tuple, if more than a row is retuned an exception is thrown. Also updates the program counter.

Specified by:
process in class ProgramInstruction
Throws:
BlockedException
MetaMatrixComponentException - if error processing command or expression on this instruction
MetaMatrixProcessingException
See Also:
ProcessorInstruction#process(ProcessorEnvironment)

processValue

protected abstract void processValue(java.lang.Object value,
                                     VariableContext varContext)
                              throws MetaMatrixComponentException,
                                     MetaMatrixProcessingException
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

getProcessorPlan

protected ProcessorPlan getProcessorPlan()

cloneState

protected void cloneState(AbstractAssignmentInstruction 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
Overrides:
getDescriptionProperties in class ProgramInstruction
Returns:
Map of properties

getDescriptionProperties

protected abstract void getDescriptionProperties(java.util.Map props)

getChildPlans

public java.util.Collection getChildPlans()
Description copied from class: ProgramInstruction
Finds all nested plans and returns them.

Overrides:
getChildPlans in class ProgramInstruction
Returns:
List of ProcessorPlan
Since:
4.2
See Also:
ProgramInstruction.getChildPlans()

getExpression

public Expression getExpression()
Returns:
Returns the expression.

setExpression

public void setExpression(Expression expression)
Parameters:
expression - The expression to set.

getProcessPlan

public ProcessorPlan getProcessPlan()
Returns:
Returns the processPlan.

setProcessPlan

public void setProcessPlan(ProcessorPlan processPlan)
Parameters:
processPlan - The processPlan to set.

getVariable

public ElementSymbol getVariable()
Returns:
Returns the variable.

setVariable

public void setVariable(ElementSymbol variable)
Parameters:
variable - The variable to set.


Copyright © 2009. All Rights Reserved.