public final class Primitives
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Function1<byte[],byte[]> |
BYTE_ARRAY_CLONER
Function which clones byte arrays.
|
static Function1<char[],char[]> |
CHAR_ARRAY_CLONER
Function which clones char arrays.
|
static Function1<double[],double[]> |
DOUBLE_ARRAY_CLONER
Function which clones double arrays.
|
static Function1<float[],float[]> |
FLOAT_ARRAY_CLONER
Function which clones float arrays.
|
static Function1<int[],int[]> |
INT_ARRAY_CLONER
Function which clones int arrays.
|
static Function1<long[],long[]> |
LONG_ARRAY_CLONER
Function which clones long arrays.
|
static Function1<short[],short[]> |
SHORT_ARRAY_CLONER
Function which clones short arrays.
|
Modifier and Type | Method and Description |
---|---|
static int |
compareUnsigned(byte b1,
byte b2)
Compare two bytes as if they are unsigned.
|
static int |
compareUnsigned(short s1,
short s2)
Compare two short integers as if they are unsigned.
|
static int |
unsigned(byte b)
Get the unsigned value of a byte.
|
static long |
unsigned(int i)
Get the unsigned value of an integer.
|
static int |
unsigned(short s)
Get the unsigned value of a short int.
|
public static final Function1<byte[],byte[]> BYTE_ARRAY_CLONER
null
is accepted.public static final Function1<short[],short[]> SHORT_ARRAY_CLONER
null
is accepted.public static final Function1<int[],int[]> INT_ARRAY_CLONER
null
is accepted.public static final Function1<long[],long[]> LONG_ARRAY_CLONER
null
is accepted.public static final Function1<char[],char[]> CHAR_ARRAY_CLONER
null
is accepted.public static final Function1<float[],float[]> FLOAT_ARRAY_CLONER
null
is accepted.public static final Function1<double[],double[]> DOUBLE_ARRAY_CLONER
null
is accepted.public static int unsigned(byte b)
b
- byte value0x00
and 0xFF
public static int unsigned(short s)
s
- short value0x0000
and 0xFFFF
public static long unsigned(int i)
i
- int value0x00000000
and 0xFFFFFFFF
public static int compareUnsigned(byte b1, byte b2)
b1
- first byte, interpreted as unsigned 8 bit valueb2
- second byte interpreted as unsigned 8 bit value0
if unsigned(b1) < unsigned(b2)
,
greater than 0
if unsigned(b1) > unsigned(b2)
,
or 0
if unsigned(b1) == unsigned(b2)
public static int compareUnsigned(short s1, short s2)
s1
- first short integer, interpreted as unsigned 16 bit values2
- second short integer interpreted as unsigned 16 bit value0
if unsigned(s1) < unsigned(s2)
,
greater than 0
if unsigned(s1) > unsigned(s2)
,
or 0
if unsigned(s1) == unsigned(s2)