Package org.apache.sshd.common.util
Class NumberUtils
java.lang.Object
org.apache.sshd.common.util.NumberUtils
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasList
(int... values) static int
diffOffset
(byte[] a1, int startPos1, byte[] a2, int startPos2, int len) static byte[]
emptyIfNull
(byte[] a) static int
getNextPowerOf2
(int value) static int
hashCode
(byte... values) static int
hashCode
(byte[] a, int offset, int len) static int
hashCode
(int... values) static int
hashCode
(long... values) static boolean
isEmpty
(byte[] a) static boolean
isEmpty
(int[] a) static boolean
isEmpty
(long[] a) static boolean
Checks if optional sign and all others are '0'-'9'static boolean
isNumericClass
(Class<?> clazz) 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
-
Field Details
-
NUMERIC_PRIMITIVE_CLASSES
-
-
Constructor Details
-
NumberUtils
private NumberUtils()
-
-
Method Details
-
getNextPowerOf2
public static int getNextPowerOf2(int value) - Parameters:
value
- The original (non-negative) value- Returns:
- The closest positive power of 2 that is greater or equal to the value. If none can be found then returns the original value
-
hashCode
public static int hashCode(long... values) -
hashCode
public static int hashCode(int... values) -
hashCode
public static int hashCode(byte... values) -
hashCode
public static int hashCode(byte[] a, int offset, int len) -
diffOffset
public static int diffOffset(byte[] a1, int startPos1, byte[] a2, int startPos2, int len) -
isNumericClass
-
toInteger
-
join
-
join
-
join
-
join
-
join
-
join
-
emptyIfNull
public static byte[] emptyIfNull(byte[] a) -
isEmpty
public static boolean isEmpty(byte[] a) -
isEmpty
public static boolean isEmpty(int[] a) -
isEmpty
public static boolean isEmpty(long[] a) -
length
public static int length(byte... a) -
length
public static int length(int... a) -
length
public static int length(long... a) -
asList
-
isIntegerNumber
Checks if optional sign and all others are '0'-'9'- Parameters:
cs
- TheCharSequence
to check- Returns:
true
if valid integer number
-