org.lsmp.djep.vectorJep.function
Class ArrayAccess
java.lang.Object
org.nfunk.jep.function.PostfixMathCommand
org.lsmp.djep.vectorJep.function.VEle
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]
Method Summary |
void |
set(EvaluatorI pv,
Node node,
java.lang.Object value)
Sets the LValue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArrayAccess
public ArrayAccess()
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 LValuevalue
- the value obtained by evaluating the right hand side.
- Throws:
ParseException
http://www.singularsys.com/jep Copyright © 2007 Singular Systems