Class ExpandingEle
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.jep.functions.Ele
com.singularsys.jep.misc.functions.ExpandingEle
- All Implemented Interfaces:
LValueI,PostfixMathCommandI,Serializable
An
var[index] function whose set(Evaluator, Node, Object) method
modifies and expands the Vector<Object> value of the variable.
This contrast with the the standard Ele class
than creating a new Vector on each call to set
and throws an EvaluationException if the index is out of range.
This can be useful for creating large lists
by repeatedly adding elements, for example:
primes = [2];
primes[2] = 3;
primes[3] = 5;
- Since:
- Jep 4.1
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.functions.Ele
indexShiftFields 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.Ele
checkNumberOfParameters, ele, ele, ele, ele, eval, findIndex, getVariableMethods inherited from class com.singularsys.jep.functions.NaryFunction
runMethods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Constructor Details
-
ExpandingEle
-
ExpandingEle
-
-
Method Details
-
set
Description copied from class:EleSets an element of an vector valued variable. For the expressionu[2] = 5the left hand node is ASTOpNode for the Ele pfmc the method will be called likeset(pv,lhs,5);The value of the variable will be replaced by a newVector<Object>with the appropriate element replaced.- Specified by:
setin interfaceLValueI- Overrides:
setin classEle- 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, root should be the ASTOpNode for the Ele pfmc.value- the value obtained by evaluating the right-hand side.- Throws:
EvaluationException- if the calculation cannot be performed
-