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

public abstract Class BooleanFunction

extends Object
implements Function, ArrayFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.ArrayFunction, org.apache.poi.ss.formula.functions.Function
Imports
org.apache.poi.ss.formula.TwoDEval, org.apache.poi.ss.formula.eval.BlankEval, .BoolEval, .ErrorEval, .EvaluationException, .MissingArgEval, .OperandResolver, .RefEval, .ValueEval

Here are the general rules concerning Boolean functions:
  1. Blanks are ignored (not either true or false)
  2. Strings are ignored if part of an area ref or cell ref, otherwise they must be 'true' or 'false'
  3. Numbers: 0 is false. Any other number is TRUE
  4. Areas: *all* cells in area are evaluated according to the above rules

Field Summary

Modifier and TypeField and Description
public static final Function
public static final Function
public static final Function
public static final Function
public static final Function

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
public final ValueEval
evaluate(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
srcRow
,
int
column index of the cell containing the formula under evaluation
srcCol
)

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

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.

private static ValueEval
evaluateFalse(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

private static ValueEval
evaluateNot(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

private static ValueEval
evaluateTrue(ValueEval[] args, int srcRowIndex, int srcColumnIndex)

protected abstract boolean
protected abstract boolean
partialEvaluate(boolean cumulativeResult, boolean currentValue)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANDback to summary
public static final Function AND
FALSEback to summary
public static final Function FALSE
NOTback to summary
public static final Function NOT
ORback to summary
public static final Function OR
TRUEback to summary
public static final Function TRUE

Constructor Detail

BooleanFunctionback to summary
public BooleanFunction()

Method Detail

calculateback to summary
private boolean calculate(ValueEval[] args) throws EvaluationException
evaluateback to summary
public final ValueEval evaluate(ValueEval[] args, int srcRow, int srcCol)

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

Parameters
args:ValueEval[]

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

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

srcRow:int

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

row index of the cell containing the formula under evaluation

srcCol:int

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

column index of the cell containing the formula under evaluation

Returns:ValueEval

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

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.

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
evaluateFalseback to summary
private static ValueEval evaluateFalse(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
evaluateNotback to summary
private static ValueEval evaluateNot(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
evaluateTrueback to summary
private static ValueEval evaluateTrue(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
getInitialResultValueback to summary
protected abstract boolean getInitialResultValue()
partialEvaluateback to summary
protected abstract boolean partialEvaluate(boolean cumulativeResult, boolean currentValue)