public abstract class PrimitiveComparator<T> extends Object implements Comparator<T>, Serializable
Comparator implementation that also supports the comparison of the related primitive type to avoid the
performance penalty of boxing/unboxing. The compare methods for the not supported primitive types throw
UnsupportedOperationException.
Serializable implementation that may be a UserDefinedPredicate defined this Comparator is their member variable.| Modifier and Type | Field and Description |
|---|---|
static PrimitiveComparator<Binary> |
UNSIGNED_LEXICOGRAPHICAL_BINARY_COMPARATOR |
| Constructor and Description |
|---|
PrimitiveComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(boolean b1,
boolean b2) |
int |
compare(double d1,
double d2) |
int |
compare(float f1,
float f2) |
int |
compare(int i1,
int i2) |
int |
compare(long l1,
long l2) |
int |
compare(T o1,
T o2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final PrimitiveComparator<Binary> UNSIGNED_LEXICOGRAPHICAL_BINARY_COMPARATOR
public int compare(boolean b1,
boolean b2)
public int compare(int i1,
int i2)
public int compare(long l1,
long l2)
public int compare(float f1,
float f2)
public int compare(double d1,
double d2)
public final int compare(T o1, T o2)
compare in interface Comparator<T>Copyright © 2023 The Apache Software Foundation. All rights reserved.