public class Ele extends PostfixMathCommand implements LValueI
a=[4,3,2,1];
a[2]; // returns 2
a[2]=5; // a is now [4,5,2,1]
curNumberOfParameters, numberOfParameters| Constructor and Description |
|---|
Ele() |
| Modifier and Type | Method and Description |
|---|---|
void |
run(Stack s)
Throws an exception because this method should never be called under
normal circumstances.
|
void |
set(EvaluatorI pv,
Node node,
Object value)
Performs appropriate action to set an LValue.
|
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameterspublic void set(EvaluatorI pv, Node node, Object value) throws ParseException
LValueIset in interface LValueIpv - 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.ParseExceptionpublic void run(Stack s) throws ParseException
PostfixMathCommandrun in interface PostfixMathCommandIrun in class PostfixMathCommandParseExceptionCopyright © 2018. All rights reserved.