public final class NumberComparator extends Object implements Comparator<Object>
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Object o1,
Object o2) |
static Comparable<Object> |
getComparable(Object o) |
static Comparator<Object> |
getComparator() |
static boolean |
isIntegerType(Number n)
Determines if a particular number is an integer-type number such as
Byte, Short, Integer, Long,
AtomicInteger or AtomicLong. |
static Number |
toNumber(Object value) |
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 Comparator<Object> getComparator()
public static Comparable<Object> getComparable(Object o)
public int compare(Object o1, Object o2)
compare in interface Comparator<Object>public static boolean isIntegerType(Number n)
Byte, Short, Integer, Long,
AtomicInteger or AtomicLong.
Note that BigInteger is not included in this set of number
classes since treatment of BigInteger requires different logic.n - Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.