public final class MultiKeyComparator extends Object implements Comparator<MultiKeyUntyped>, MetaDefItem, Serializable
Constructor and Description |
---|
MultiKeyComparator(boolean[] isDescendingValues)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(MultiKeyUntyped firstValues,
MultiKeyUntyped secondValues) |
protected static int |
compareValues(Object valueOne,
Object valueTwo,
boolean isDescending)
Compares two nullable values.
|
static int |
compareValuesCollated(Object valueOne,
Object valueTwo,
boolean isDescending,
Collator collator)
Compares two nullable values using Collator, for use with string-typed values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public MultiKeyComparator(boolean[] isDescendingValues)
isDescendingValues
- - each value is true if the corresponding (same index)
entry in the multi-keys is to be sorted in descending order. The multikeys
to be compared must have the same number of values as this array.public final int compare(MultiKeyUntyped firstValues, MultiKeyUntyped secondValues)
compare
in interface Comparator<MultiKeyUntyped>
protected static int compareValues(Object valueOne, Object valueTwo, boolean isDescending)
valueOne
- first value to comparevalueTwo
- second value to compareisDescending
- true for descendingpublic static int compareValuesCollated(Object valueOne, Object valueTwo, boolean isDescending, Collator collator)
valueOne
- first value to comparevalueTwo
- second value to compareisDescending
- true for descendingcollator
- the Collator for comparing