org.apache.poi.ss.formula.functions
Class NumericFunction

java.lang.Object
  extended by org.apache.poi.ss.formula.functions.NumericFunction
All Implemented Interfaces:
Function

public abstract class NumericFunction
extends java.lang.Object
implements Function

Author:
Amol S. Deshmukh < amolweb at ya hoo dot com >, Josh Micich, Stephen Wolke (smwolke at geistig.com)

Nested Class Summary
static class NumericFunction.OneArg
           
static class NumericFunction.TwoArg
           
 
Field Summary
static Function ABS
           
static Function ACOS
           
static Function ACOSH
           
static Function ASIN
           
static Function ASINH
           
static Function ATAN
           
static Function ATAN2
           
static Function ATANH
           
static Function CEILING
           
static Function COMBIN
           
static Function COS
           
static Function COSH
           
static Function DEGREES
           
static Function DOLLAR
           
static Function EXP
           
static Function FACT
           
static Function FLOOR
           
static Function INT
           
static Function LN
           
static Function LOG
           
static Function LOG10
           
static Function MOD
           
static Function PI
           
static Function POISSON
           
static Function POWER
           
static Function RADIANS
           
static Function RAND
           
static Function ROUND
           
static Function ROUNDDOWN
           
static Function ROUNDUP
           
static Function SIGN
           
static Function SIN
           
static Function SINH
           
static Function SQRT
           
static Function TAN
           
static Function TANH
           
static Function TRUNC
           
 
Constructor Summary
NumericFunction()
           
 
Method Summary
static void checkValue(double result)
           
protected abstract  double eval(ValueEval[] args, int srcCellRow, int srcCellCol)
           
 ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol)
           
protected static double singleOperandEvaluate(ValueEval arg, int srcRowIndex, int srcColumnIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABS

public static final Function ABS

ACOS

public static final Function ACOS

ACOSH

public static final Function ACOSH

ASIN

public static final Function ASIN

ASINH

public static final Function ASINH

ATAN

public static final Function ATAN

ATANH

public static final Function ATANH

COS

public static final Function COS

COSH

public static final Function COSH

DEGREES

public static final Function DEGREES

DOLLAR

public static final Function DOLLAR

EXP

public static final Function EXP

FACT

public static final Function FACT

INT

public static final Function INT

LN

public static final Function LN

LOG10

public static final Function LOG10

RADIANS

public static final Function RADIANS

SIGN

public static final Function SIGN

SIN

public static final Function SIN

SINH

public static final Function SINH

SQRT

public static final Function SQRT

TAN

public static final Function TAN

TANH

public static final Function TANH

ATAN2

public static final Function ATAN2

CEILING

public static final Function CEILING

COMBIN

public static final Function COMBIN

FLOOR

public static final Function FLOOR

MOD

public static final Function MOD

POWER

public static final Function POWER

ROUND

public static final Function ROUND

ROUNDDOWN

public static final Function ROUNDDOWN

ROUNDUP

public static final Function ROUNDUP

TRUNC

public static final Function TRUNC

LOG

public static final Function LOG

PI

public static final Function PI

RAND

public static final Function RAND

POISSON

public static final Function POISSON
Constructor Detail

NumericFunction

public NumericFunction()
Method Detail

singleOperandEvaluate

protected static final double singleOperandEvaluate(ValueEval arg,
                                                    int srcRowIndex,
                                                    int srcColumnIndex)
                                             throws EvaluationException
Throws:
EvaluationException

checkValue

public static final void checkValue(double result)
                             throws EvaluationException
Throws:
EvaluationException - (#NUM!) if result is NaN or Infinity

evaluate

public final ValueEval evaluate(ValueEval[] args,
                                int srcCellRow,
                                int srcCellCol)
Specified by:
evaluate in interface Function
Parameters:
args - the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
srcCellRow - row index of the cell containing the formula under evaluation
srcCellCol - column index of the cell containing the formula under evaluation
Returns:
The evaluated result, possibly an ErrorEval, never null. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate to Double.NaN be sure to translate the result to ErrorEval.NUM_ERROR.

eval

protected abstract double eval(ValueEval[] args,
                               int srcCellRow,
                               int srcCellCol)
                        throws EvaluationException
Throws:
EvaluationException


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.