|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.client.impl.protocol.util.BitUtil
public final class BitUtil
Miscellaneous useful functions for dealing with low level bits and bytes.
Field Summary | |
---|---|
static short |
BYTE_MASK
byte mask |
static int |
CACHE_LINE_LENGTH
Length of the data blocks used by the CPU cache sub-system in bytes. |
static int |
INT_MASK
Int mask |
static long |
LONG_MASK
Long mask |
static int |
SIZE_OF_BOOLEAN
Size of a boolean in bytes |
static int |
SIZE_OF_BYTE
Size of a byte in bytes |
static int |
SIZE_OF_CHAR
Size of a char in bytes |
static int |
SIZE_OF_DOUBLE
Size of a double in bytes |
static int |
SIZE_OF_FLOAT
Size of a a float in bytes |
static int |
SIZE_OF_INT
Size of an int in bytes |
static int |
SIZE_OF_LONG
Size of a long in bytes |
static int |
SIZE_OF_SHORT
Size of a short in bytes |
static Charset |
UTF8_CHARSET
UTF-8 charset |
Method Summary | |
---|---|
static int |
align(int value,
int alignment)
Align a value to the next multiple up of an alignment number. |
static int |
findNextPositivePowerOfTwo(int value)
Fast method of finding the next power of 2 greater than or equal to the supplied value. |
static boolean |
isEven(int value)
Checks to see if a value is an even number. |
static boolean |
isPowerOfTwo(int value)
Checks to see if a value is a positive power of two. |
static int |
next(int current,
int max)
Cycles the indices of an array one at a time in a forward fashion. |
static int |
previous(int current,
int max)
Cycles the indices of an array one at a time in a backwards fashion. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SIZE_OF_BYTE
public static final int SIZE_OF_BOOLEAN
public static final int SIZE_OF_CHAR
public static final int SIZE_OF_SHORT
public static final int SIZE_OF_INT
public static final int SIZE_OF_FLOAT
public static final int SIZE_OF_LONG
public static final int SIZE_OF_DOUBLE
public static final int CACHE_LINE_LENGTH
public static final long LONG_MASK
public static final int INT_MASK
public static final short BYTE_MASK
public static final Charset UTF8_CHARSET
Method Detail |
---|
public static int findNextPositivePowerOfTwo(int value)
Integer.MIN_VALUE
or numbers greater than 2^30.
value
- The value from which to search for the next power of 2.
public static int align(int value, int alignment)
value
- The value to be aligned to the next multiple up of the alignment number.alignment
- The alignment number to be used.
public static boolean isEven(int value)
value
- The value to check.
public static boolean isPowerOfTwo(int value)
value
- The value to check.
public static int next(int current, int max)
current
- The index array value to be incremented.max
- The maximum value for the index cycle.
public static int previous(int current, int max)
current
- The index array value to be decremented.max
- The maximum value for the index cycle.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |