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 intdiffOffset(byte[] a1, int startPos1, byte[] a2, int startPos2, int len) static byte[]emptyIfNull(byte[] a) static intgetNextPowerOf2(int value) static inthashCode(byte... values) static inthashCode(byte[] a, int offset, int len) static inthashCode(int... values) static inthashCode(long... values) static booleanisEmpty(byte[] a) static booleanisEmpty(int[] a) static booleanisEmpty(long[] a) static booleanChecks if optional sign and all others are '0'-'9'static booleanisNumericClass(Class<?> clazz) static Stringjoin(char separator, boolean unsigned, byte... values) static Stringjoin(char separator, int... values) static Stringjoin(char separator, long... values) static Stringjoin(CharSequence separator, boolean unsigned, byte... values) static Stringjoin(CharSequence separator, int... values) static Stringjoin(CharSequence separator, long... values) static intlength(byte... a) static intlength(int... a) static intlength(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- TheCharSequenceto check- Returns:
trueif valid integer number
-