org.shiftone.bigcalc.math.constants
Class NumericConstantFileFunction

java.lang.Object
  extended byorg.shiftone.bigcalc.core.function.AbstractNoArgumentFunction
      extended byorg.shiftone.bigcalc.math.constants.NumericConstantFileFunction
All Implemented Interfaces:
Function, Functor

public class NumericConstantFileFunction
extends AbstractNoArgumentFunction
implements Function

As it turns out, it's way faster to just load 10k digits of pi from a file than it is to calculate it - who knew.

Version:
$Revision: 1.6 $
Author:
$Author: jeffdrost $

Constructor Summary
NumericConstantFileFunction(java.lang.String resourceName)
           
 
Method Summary
 java.lang.Object evaluate(Context context)
           
 void print(java.lang.StringBuffer sb, Context context)
           
 
Methods inherited from class org.shiftone.bigcalc.core.function.AbstractNoArgumentFunction
setArguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.shiftone.bigcalc.Function
setArguments
 

Constructor Detail

NumericConstantFileFunction

public NumericConstantFileFunction(java.lang.String resourceName)
Method Detail

evaluate

public java.lang.Object evaluate(Context context)
                          throws java.lang.Exception
Specified by:
evaluate in interface Functor
Throws:
java.lang.Exception

print

public void print(java.lang.StringBuffer sb,
                  Context context)
           throws java.lang.Exception
Specified by:
print in interface Functor
Throws:
java.lang.Exception