KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nfunk > jep > function > PostfixMathCommandI


1 /*****************************************************************************
2
3 JEP - Java Math Expression Parser 2.3.0
4       October 3 2004
5       (c) Copyright 2004, Nathan Funk and Richard Morris
6       See LICENSE.txt for license information.
7
8 *****************************************************************************/

9
10 package org.nfunk.jep.function;
11
12 import java.util.*;
13 import org.nfunk.jep.*;
14
15
16 /**
17  * All function classes must implement this interface to ensure that the run()
18  * method is implemented.
19  */

20 public interface PostfixMathCommandI
21 {
22     /**
23      * Run the function on the stack. Pops the arguments from the stack, and
24      * pushes the result on the top of the stack.
25      */

26     public void run(Stack aStack) throws ParseException;
27     
28     /**
29      * Returns the number of required parameters, or -1 if any number of
30      * parameters is allowed.
31      */

32     public int getNumberOfParameters();
33
34     /**
35      * Sets the number of current number of parameters used in the next call
36      * of run(). This method is only called when the reqNumberOfParameters is
37      * -1.
38      */

39     public void setCurNumberOfParameters(int n);
40 }
41
Popular Tags