|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.Ele
public class Ele
Function which allows array access using the a[3] notation on left and
right hand side. The first element is indexed with 1.
a=[4,3,2,1];
a[2]; // Returns 2
a[2]=5; // Sets the 2nd element of a to 5. So a is now [4,5,2,1]
b=[[1,2,3],[4,5,6]];
b[2][3]; // returns 6
b[2][3]=7; // sets 3rd element of 2nd row to 7 (only works with the configurable parser)
Field Summary |
---|
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand |
---|
curNumberOfParameters, numberOfParameters |
Constructor Summary | |
---|---|
Ele()
Element access with mathematical convention, first element has index 1 |
|
Ele(boolean javaIndex)
Element access with mathematical convention, first element has index 1 |
Method Summary | |
---|---|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function. |
void |
run(java.util.Stack<java.lang.Object> s)
Run the function on the stack. |
void |
set(Evaluator pv,
Node node,
java.lang.Object value)
Performs appropriate action to set an LValue. |
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand |
---|
checkStack, getNumberOfParameters, setCurNumberOfParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Ele()
public Ele(boolean javaIndex)
javaIndex
- Method Detail |
---|
public boolean checkNumberOfParameters(int n)
PostfixMathCommand
checkNumberOfParameters
in interface PostfixMathCommandI
checkNumberOfParameters
in class PostfixMathCommand
n
- number of parameters function will be called with.
public void set(Evaluator pv, Node node, java.lang.Object value) throws EvaluationException
LValueI
set
in interface LValueI
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.
EvaluationException
public void run(java.util.Stack<java.lang.Object> s) throws EvaluationException
PostfixMathCommandI
run
in interface PostfixMathCommandI
EvaluationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |