public final class NumberUtils extends Object
Modifier and Type | Field and Description |
---|---|
static List<Class<?>> |
NUMERIC_PRIMITIVE_CLASSES
|
static List<Long> |
POWERS_OF_TWO
A
List containing all the pure powers of 2 for a long
value. |
Modifier and Type | Method and Description |
---|---|
static List<Integer> |
asList(int... values) |
static int |
getNextPowerOf2(int value) |
static long |
getNextPowerOf2(long value) |
static int |
hashCode(int... values) |
static int |
hashCode(long... values) |
static int |
hashCode(long value) |
static boolean |
isEmpty(byte[] a) |
static boolean |
isEmpty(int[] a) |
static boolean |
isEmpty(long[] a) |
static boolean |
isIntegerNumber(CharSequence cs)
Checks if optional sign and all others are '0'-'9'
|
static boolean |
isNumericClass(Class<?> clazz) |
static boolean |
isPowerOf2(long value) |
static String |
join(char separator,
boolean unsigned,
byte... values) |
static String |
join(char separator,
int... values) |
static String |
join(char separator,
long... values) |
static String |
join(CharSequence separator,
boolean unsigned,
byte... values) |
static String |
join(CharSequence separator,
int... values) |
static String |
join(CharSequence separator,
long... values) |
static int |
length(byte... a) |
static int |
length(int... a) |
static int |
length(long... a) |
static Integer |
toInteger(Number n)
|
public static boolean isPowerOf2(long value)
public static long getNextPowerOf2(long value)
public static int getNextPowerOf2(int value)
public static int hashCode(long... values)
public static int hashCode(int... values)
public static int hashCode(long value)
public static boolean isNumericClass(Class<?> clazz)
clazz
- The Class
to examine - ignored if null
Number
or one of the primitive numerical typesNUMERIC_PRIMITIVE_CLASSES
public static String join(CharSequence separator, long... values)
public static String join(char separator, long... values)
public static String join(CharSequence separator, boolean unsigned, byte... values)
public static String join(char separator, boolean unsigned, byte... values)
public static String join(CharSequence separator, int... values)
public static String join(char separator, int... values)
public static boolean isEmpty(byte[] a)
public static boolean isEmpty(int[] a)
public static boolean isEmpty(long[] a)
public static int length(byte... a)
public static int length(int... a)
public static int length(long... a)
public static boolean isIntegerNumber(CharSequence cs)
cs
- The CharSequence
to checktrue
if valid integer numberCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.