org.apache.poi.ss.formula.functions

## Class BooleanFunction

- java.lang.Object
- - org.apache.poi.ss.formula.functions.BooleanFunction

- All Implemented Interfaces:
    ArrayFunction, Function

      public abstract class BooleanFunction
      extends java.lang.Object
      implements Function, ArrayFunction

  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
  Author:
    Amol S. Deshmukh < amolweb at ya hoo dot com >

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Function` | `AND`
    `static Function` | `FALSE`
    `static Function` | `NOT`
    `static Function` | `OR`
    `static Function` | `TRUE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BooleanFunction()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ValueEval` | `evaluate(ValueEval[] args, int srcRow, int srcCol)`
    `ValueEval` | `evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)`
    `protected abstract boolean` | `getInitialResultValue()`
    `protected abstract boolean` | `partialEvaluate(boolean cumulativeResult, boolean currentValue)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.poi.ss.formula.functions.ArrayFunction

      `evaluateOneArrayArg, evaluateTwoArrayArgs`

- - ### Field Detail

    - #### AND

          public static final Function AND

    - #### OR

          public static final Function OR

    - #### FALSE

          public static final Function FALSE

    - #### TRUE

          public static final Function TRUE

    - #### NOT

          public static final Function NOT

  - ### Constructor Detail

    - #### BooleanFunction

          public BooleanFunction()

  - ### Method Detail

    - #### evaluate

          public final ValueEval evaluate(ValueEval[] args,
                                          int srcRow,
                                          int srcCol)

      Specified by:
        `evaluate` in interface `Function`
      Parameters:
        `args` - the evaluated function arguments. Empty values are represented with `BlankEval` or `MissingArgEval`, never `null`.
        `srcRow` - row index of the cell containing the formula under evaluation
        `srcCol` - 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`.

    - #### getInitialResultValue

          protected abstract boolean getInitialResultValue()

    - #### partialEvaluate

          protected abstract boolean partialEvaluate(boolean cumulativeResult,
                                                     boolean currentValue)

    - #### evaluateArray

          public ValueEval evaluateArray(ValueEval[] args,
                                         int srcRowIndex,
                                         int srcColumnIndex)

      Specified by:
        `evaluateArray` in interface `ArrayFunction`
      Parameters:
        `args` - the evaluated function arguments. Empty values are represented with `BlankEval` or `MissingArgEval`, never `null`.
        `srcRowIndex` - row index of the cell containing the formula under evaluation
        `srcColumnIndex` - 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`.

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