Class LookupUtils.CompareResult
java.lang.Object
org.apache.poi.ss.formula.functions.LookupUtils.CompareResult
- Enclosing class:
LookupUtils
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LookupUtils.CompareResultstatic final LookupUtils.CompareResultstatic final LookupUtils.CompareResultstatic final LookupUtils.CompareResult -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEqual()booleanbooleanbooleantoString()static LookupUtils.CompareResultvalueOf(boolean matches) static LookupUtils.CompareResultvalueOf(int simpleCompareResult)