Package org.apache.calcite.util
Class CaseInsensitiveComparator
- java.lang.Object
-
- org.apache.calcite.util.CaseInsensitiveComparator
-
- All Implemented Interfaces:
java.util.Comparator
class CaseInsensitiveComparator extends java.lang.Object implements java.util.Comparator
Comparator that compares all strings differently, but if two strings are equal in case-insensitive match they are right next to each other.Note: strings that differ only in upper-lower case are treated by this comparator as distinct.
In a collection sorted on this comparator, we can find case-insensitive matches for a given string using
floorKey(java.lang.String)
andceilingKey(java.lang.String)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CaseInsensitiveComparator.Key
Enables to create floor and ceiling keys for given string.
-
Field Summary
Fields Modifier and Type Field Description (package private) static CaseInsensitiveComparator
COMPARATOR
-
Constructor Summary
Constructors Constructor Description CaseInsensitiveComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.Object
ceilingKey(java.lang.String key)
int
compare(java.lang.Object o1, java.lang.Object o2)
(package private) java.lang.Object
floorKey(java.lang.String key)
-
-
-
Field Detail
-
COMPARATOR
static final CaseInsensitiveComparator COMPARATOR
-
-