org.apache.poi.ss.formula.functions
Class NumericFunction
java.lang.Object
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)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
NumericFunction
public NumericFunction()
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 evaluationsrcCellCol
- 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.