public static final class Numbers.Compound extends Object
short
is 16 bits in size, allowing it to represent a compound value
of 2 byte
s, since a byte
is 8 bits in size.Modifier and Type | Method and Description |
---|---|
static byte |
decodeByte(int val,
int pos)
Decodes the
byte value at the specified position that is
represented in the provided compounded int value. |
static byte |
decodeByte(long val,
int pos)
Decodes the
byte value at the specified position that is
represented in the provided compounded long value. |
static byte |
decodeByte(short val,
int pos)
Decodes the
byte value at the specified position that is
represented in the provided compounded short value. |
static float |
decodeFloat(long val,
int pos)
Decodes the
float value at the specified position that is
represented in the provided compounded long value. |
static int |
decodeInt(long val,
int pos)
Decodes the
int value at the specified position that is
represented in the provided compounded long value. |
static short |
decodeShort(int val,
int pos)
Decodes the
short value at the specified position that is
represented in the provided compounded int value. |
static short |
decodeShort(long val,
int pos)
Decodes the
short value at the specified position that is
represented in the provided compounded long value. |
static short |
encode(byte a,
byte b)
Encodes two
byte s into a short . |
static int |
encode(byte a,
byte b,
byte c,
byte d)
Encodes four
byte s into an int . |
static long |
encode(byte a,
byte b,
byte c,
byte d,
byte e,
byte f,
byte g,
byte h)
Encodes eight
byte s into a long . |
static long |
encode(float a,
float b)
Encodes two
float s into a long . |
static long |
encode(float a,
int b)
Encodes a
float and an int into a long . |
static long |
encode(int a,
float b)
Encodes an
int and a float into a long . |
static long |
encode(int a,
int b)
Encodes two
int s into a long . |
static int |
encode(short a,
short b)
Encodes two
short s into an int . |
static long |
encode(short a,
short b,
short c,
short d)
Encodes four
short s into a long . |
public static long encode(int a, int b)
int
s into a long
.a
- The first int
.b
- The second int
.long
representing two int
.public static long encode(short a, short b, short c, short d)
short
s into a long
.a
- The first short
.b
- The second short
.c
- The third short
.d
- The fourth short
.long
representing four short
.public static long encode(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h)
byte
s into a long
.a
- The first byte
.b
- The second byte
.c
- The third byte
.d
- The fourth byte
.e
- The fifth byte
.f
- The sixth byte
.g
- The seventh byte
.h
- The eighth byte
.long
representing eighth byte
.public static long encode(float a, float b)
float
s into a long
.a
- The first float
.b
- The second float
.long
representing two float
s.public static long encode(float a, int b)
float
and an int
into a long
.a
- The float
.b
- The int
.long
representing a float
and an
int
.public static long encode(int a, float b)
int
and a float
into a long
.a
- The int
.b
- The float
.long
representing an int
and a
float
.public static int encode(short a, short b)
short
s into an int
.a
- The first short
.b
- The second short
.int
representing two short
.public static int encode(byte a, byte b, byte c, byte d)
byte
s into an int
.a
- The first byte
.b
- The second byte
.c
- The third byte
.d
- The fourth byte
.int
representing two byte
.public static short encode(byte a, byte b)
byte
s into a short
.a
- The first byte
.b
- The second byte
.short
representing two byte
.public static int decodeInt(long val, int pos)
int
value at the specified position that is
represented in the provided compounded long
value.val
- The compounded long
containing int
.pos
- The position of the value to decode (0, 1).int
value at the specified position that is
represented in the provided compounded long
value.public static float decodeFloat(long val, int pos)
float
value at the specified position that is
represented in the provided compounded long
value.val
- The compounded long
containing a float
value.pos
- The position of the value to decode (0, 1).float
value at the specified position that is
represented in the provided compounded long
value.public static short decodeShort(long val, int pos)
short
value at the specified position that is
represented in the provided compounded long
value.val
- The compounded long
containing short
.pos
- The position of the value to decode (0, 1, 2, 3).short
value at the specified position that is
represented in the provided compounded long
value.public static byte decodeByte(long val, int pos)
byte
value at the specified position that is
represented in the provided compounded long
value.val
- The compounded long
containing byte
.pos
- The position of the value to decode (0, 1, 2, 3, 4, 5, 6, 7).byte
value at the specified position that is
represented in the provided compounded long
value.public static short decodeShort(int val, int pos)
short
value at the specified position that is
represented in the provided compounded int
value.val
- The compounded int
containing short
.pos
- The position of the value to decode (0, 1).short
value at the specified position that is
represented in the provided compounded int
value.public static byte decodeByte(int val, int pos)
byte
value at the specified position that is
represented in the provided compounded int
value.val
- The compounded int
containing byte
.pos
- The position of the value to decode (0, 1, 2, 3).byte
value at the specified position that is
represented in the provided compounded int
value.public static byte decodeByte(short val, int pos)
byte
value at the specified position that is
represented in the provided compounded short
value.val
- The compounded short
containing byte
.pos
- The position of the value to decode (0, 1).byte
value at the specified position that is
represented in the provided compounded short
value.Copyright © 2020 LibJ. All rights reserved.