Class 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]
  • Constructor Details

    • ArrayAccess

      public ArrayAccess()
  • Method Details

    • set

      public void set(EvaluatorI pv, Node node, 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