Class LookupUtils.CompareResult

java.lang.Object
org.apache.poi.ss.formula.functions.LookupUtils.CompareResult
Enclosing class:
LookupUtils

public static final class LookupUtils.CompareResult extends Object
Enumeration to support 4 valued comparison results.

Excel lookup functions have complex behaviour in the case where the lookup array has mixed types, and/or is unordered. Contrary to suggestions in some Excel documentation, there does not appear to be a universal ordering across types. The binary search algorithm used changes behaviour when the evaluated 'mid' value has a different type to the lookup value.

A simple int might have done the same job, but there is risk in confusion with the well known Comparable.compareTo() and Comparator.compare() which both use a ubiquitous 3 value result encoding.