Class AssignableList
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.List
com.singularsys.jep.misc.functions.AssignableList
- All Implemented Interfaces:
LValueI,PostfixMathCommandI,Serializable
A list than can be assigned to
[x,y,z] = [1,2,3].
Items in the left hand side list must be variables or functions implementing LValueI.
This allow elements in a vector to be swapped [v[2],v[1]]=v.
This function can be used as a replacement for
List
Jep jep = new Jep(new StandardConfigurableParser());
jep.getOperatorTable().getList().setPFMC(new AssignableList());
Node n = jep.parse("[x,y] = [3,4]");
Object res = jep.evaluate(n);
- Since:
- Jep 4.1
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, checkNumberOfParameters, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Constructor Details
-
AssignableList
public AssignableList()
-
-
Method Details
-
set
Description copied from interface:LValueIPerforms appropriate action to set an LValue.- Specified by:
setin interfaceLValueI- 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:
EvaluationException- if the calculation cannot be performed
-