public final class MultiKeyComparator extends java.lang.Object implements java.util.Comparator<MultiKeyUntyped>, MetaDefItem, java.io.Serializable
Constructor and Description |
---|
MultiKeyComparator(boolean[] isDescendingValues)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(MultiKeyUntyped firstValues,
MultiKeyUntyped secondValues) |
static int |
compareValuesCollated(java.lang.Object valueOne,
java.lang.Object valueTwo,
boolean isDescending,
java.text.Collator collator)
Compares two nullable values using Collator, for use with string-typed values.
|
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 java.util.Comparator<MultiKeyUntyped>
public static int compareValuesCollated(java.lang.Object valueOne, java.lang.Object valueTwo, boolean isDescending, java.text.Collator collator)
valueOne
- first value to comparevalueTwo
- second value to compareisDescending
- true for descendingcollator
- the Collator for comparing