org.nfunk.jep.function
Class Ele

java.lang.Object
  extended by org.nfunk.jep.function.PostfixMathCommand
      extended by org.nfunk.jep.function.Ele
All Implemented Interfaces:
LValueI, PostfixMathCommandI

public class Ele
extends PostfixMathCommand
implements LValueI

Function which allows array access using the a[3] notation on left and right hand side. a=[4,3,2,1]; a[2]; // returns 2 a[2]=5; // a is now [4,5,2,1]

Author:
Richard Morris

Field Summary
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
Ele()
           
 
Method Summary
 void run(java.util.Stack s)
          Throws an exception because this method should never be called under normal circumstances.
 void set(EvaluatorI pv, Node node, java.lang.Object value)
          Performs appropriate action to set an LValue.
 
Methods inherited from class org.nfunk.jep.function.PostfixMathCommand
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ele

public Ele()
Method Detail

set

public void set(EvaluatorI pv,
                Node node,
                java.lang.Object value)
         throws ParseException
Description copied from interface: LValueI
Performs appropriate action to set an LValue.

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

run

public void run(java.util.Stack s)
         throws ParseException
Description copied from class: PostfixMathCommand
Throws an exception because this method should never be called under normal circumstances. Each function should use it's own run() method for evaluating the function. This includes popping off the parameters from the stack, and pushing the result back on the stack.

Specified by:
run in interface PostfixMathCommandI
Overrides:
run in class PostfixMathCommand
Throws:
ParseException


http://www.singularsys.com/jep Copyright © 2007 Singular Systems