KickJava   Java API By Example, From Geeks To Geeks.

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


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 package org.nfunk.jep.function;
10
11 import java.util.*;
12 import org.nfunk.jep.*;
13
14 /**
15  * Converts an object into its string representation.
16  * Calls the toString method of the object.
17  *
18  * @author Rich Morris
19  * Created on 27-Mar-2004
20  */

21 public class Str extends PostfixMathCommand
22 {
23     public Str()
24     {
25         numberOfParameters = 1;
26     }
27     
28     public void run(Stack inStack)
29         throws ParseException
30     {
31         checkStack(inStack);// check the stack
32
Object JavaDoc param = inStack.pop();
33         inStack.push(param.toString());//push the result on the inStack
34
return;
35     }
36 }
37
Popular Tags