public static final class LookupUtils.CompareResult
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
static LookupUtils.CompareResult |
EQUAL |
static LookupUtils.CompareResult |
GREATER_THAN |
static LookupUtils.CompareResult |
LESS_THAN |
static LookupUtils.CompareResult |
TYPE_MISMATCH |
Modifier and Type | Method and Description |
---|---|
boolean |
isEqual() |
boolean |
isGreaterThan() |
boolean |
isLessThan() |
boolean |
isTypeMismatch() |
java.lang.String |
toString() |
static LookupUtils.CompareResult |
valueOf(boolean matches) |
static LookupUtils.CompareResult |
valueOf(int simpleCompareResult) |
public static final LookupUtils.CompareResult TYPE_MISMATCH
public static final LookupUtils.CompareResult LESS_THAN
public static final LookupUtils.CompareResult EQUAL
public static final LookupUtils.CompareResult GREATER_THAN
public static LookupUtils.CompareResult valueOf(int simpleCompareResult)
public static LookupUtils.CompareResult valueOf(boolean matches)
public boolean isTypeMismatch()
public boolean isLessThan()
public boolean isEqual()
public boolean isGreaterThan()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.