org.lsmp.djep.matrixJep.function
Class MAssign

java.lang.Object
  extended byorg.nfunk.jep.function.PostfixMathCommand
      extended byorg.nfunk.jep.function.Assign
          extended byorg.lsmp.djep.matrixJep.function.MAssign
All Implemented Interfaces:
MatrixSpecialEvaluationI, PostfixMathCommandI, SpecialEvaluationI

public class MAssign
extends Assign
implements MatrixSpecialEvaluationI

A matrix enabled asignment function. The lhs of an assigment must be a variable.

Author:
Rich Morris Created on 23-Feb-2004

Field Summary
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
MAssign()
           
 
Method Summary
 MatrixValueI evaluate(MatrixNodeI node, MatrixEvaluator visitor, MatrixJep j)
          A special methods for evaluating an assignment.
 void run(java.util.Stack s)
          The run method should not be called.
 
Methods inherited from class org.nfunk.jep.function.Assign
evaluate
 
Methods inherited from class org.nfunk.jep.function.PostfixMathCommand
checkStack, getNumberOfParameters, setCurNumberOfParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MAssign

public MAssign()
Method Detail

run

public void run(java.util.Stack s)
         throws ParseException
The run method should not be called. Use evaluate(org.lsmp.djep.matrixJep.nodeTypes.MatrixNodeI, org.lsmp.djep.matrixJep.MatrixEvaluator, org.lsmp.djep.matrixJep.MatrixJep) instead.

Specified by:
run in interface PostfixMathCommandI
Overrides:
run in class PostfixMathCommand
Throws:
ParseException

evaluate

public MatrixValueI evaluate(MatrixNodeI node,
                             MatrixEvaluator visitor,
                             MatrixJep j)
                      throws ParseException
A special methods for evaluating an assignment. When an asignment is encountered, first evaluate the rhs. Then set the value of the lhs to the result.

Specified by:
evaluate in interface MatrixSpecialEvaluationI
Parameters:
node - The top node.
visitor - The parser visitor
j - The current MatrixJep instance.
Returns:
Value after evaluation.
Throws:
ParseException


http://www.singularsys.com/jep Copyright © 2004 Singular Systems