Top Description Constructors Methods
org.apache.poi.ss.formula.functions

public final Class IfFunc

extends Var2or3ArgFunction
implements ArrayFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.ArrayFunction
Imports
org.apache.poi.ss.formula.CacheAreaEval, .FormulaParseException, org.apache.poi.ss.formula.eval.*, org.apache.poi.ss.formula.ptg.Ptg, .RefPtg

Implementation for the Excel function IF

Note that Excel is a bit picky about the arguments to this function, when serialised into Ptgs in a HSSF file. While most cases are pretty chilled about the R vs V state of RefPtg arguments, for IF special care is needed to avoid Excel showing #VALUE. See bug numbers #55324 and #55747 for the full details on this. TODO Fix this...

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ValueEval
public ValueEval
public ValueEval
evaluateArray(ValueEval[]
the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
args
,
int
row index of the cell containing the formula under evaluation
srcRowIndex
,
int
column index of the cell containing the formula under evaluation
srcColumnIndex
)

Implements org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

pack-priv ValueEval
evaluateArrayArgs(ValueEval arg0, ValueEval arg1, ValueEval arg2, int srcRowIndex, int srcColumnIndex)

public static boolean
evaluateFirstArg(ValueEval arg, int srcCellRow, int srcCellCol)

Inherited from org.apache.poi.ss.formula.functions.Var2or3ArgFunction:
evaluate

Constructor Detail

IfFuncback to summary
public IfFunc()

Method Detail

evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)

Implements org.apache.poi.ss.formula.functions.Function2Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function2Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2)

Implements org.apache.poi.ss.formula.functions.Function3Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function3Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
evaluateArrayback to summary
public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

Implements org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

Parameters
args:ValueEval[]

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.

srcRowIndex:int

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

row index of the cell containing the formula under evaluation

srcColumnIndex:int

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

column index of the cell containing the formula under evaluation

Returns:ValueEval

Doc from org.apache.poi.ss.formula.functions.ArrayFunction.evaluateArray.

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.

Annotations
@Override
evaluateArrayArgsback to summary
pack-priv ValueEval evaluateArrayArgs(ValueEval arg0, ValueEval arg1, ValueEval arg2, int srcRowIndex, int srcColumnIndex)
evaluateFirstArgback to summary
public static boolean evaluateFirstArg(ValueEval arg, int srcCellRow, int srcCellCol) throws EvaluationException