org.nfunk.jep.function
Class Round

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

public class Round
extends PostfixMathCommand

A PostfixMathCommandI which rounds a number round(pi) finds the closest integer to the argument round(pi,3) rounds the argument to 3 decimal places

Author:
Richard Morris

Field Summary
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
Round()
           
 
Method Summary
 java.lang.Object round(java.lang.Object param)
           
 void run(java.util.Stack inStack)
          Throws an exception because this method should never be called under normal circumstances.
 
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

Round

public Round()
Method Detail

run

public void run(java.util.Stack inStack)
         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

round

public java.lang.Object round(java.lang.Object param)
                       throws ParseException
Throws:
ParseException


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