org.lsmp.djep.vectorJep.function
Class ArrayAccess

java.lang.Object
  extended by org.nfunk.jep.function.PostfixMathCommand
      extended by org.lsmp.djep.vectorJep.function.VEle
          extended by org.lsmp.djep.vectorJep.function.ArrayAccess
All Implemented Interfaces:
BinaryOperatorI, LValueI, PostfixMathCommandI
Direct Known Subclasses:
MArrayAccess

public class ArrayAccess
extends VEle
implements LValueI

A postfix MathCommand which facilitates the getting and setting of vector and matrix elements. The class implements the set method of LValueI., read access is handled by parent VEle class. For examples a=[1,2,3]; a[2]=4; b=[[1,2],[3,4]]; b[2,1]=5;

Author:
Richard Morris TODO implement setting slices a[3:5]=[3,4,5] a[1,]=[1,3]

Field Summary
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
ArrayAccess()
           
 
Method Summary
 void set(EvaluatorI pv, Node node, java.lang.Object value)
          Sets the LValue.
 
Methods inherited from class org.lsmp.djep.vectorJep.function.VEle
calcDim, calcValue, run
 
Methods inherited from class org.nfunk.jep.function.PostfixMathCommand
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nfunk.jep.function.PostfixMathCommandI
checkNumberOfParameters, getNumberOfParameters, setCurNumberOfParameters
 

Constructor Detail

ArrayAccess

public ArrayAccess()
Method Detail

set

public void set(EvaluatorI pv,
                Node node,
                java.lang.Object value)
         throws ParseException
Sets the LValue. For the equation a[2]=5

Specified by:
set in interface LValueI
Parameters:
pv - a pointer to the evaluator. The pv.eval() method can be used to evaluate the children of the node.
node - The top node for the LValue
value - the value obtained by evaluating the right hand side.
Throws:
ParseException


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