Package com.actelion.research.util
Class BitUtils
- java.lang.Object
-
- com.actelion.research.util.BitUtils
-
public class BitUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static long
MASK_FIRST_SHORT
static long
MASK_FOURTH_SHORT
static long
MASK_SEC_SHORT
static long
MASK_THIRD_SHORT
-
Constructor Summary
Constructors Constructor Description BitUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static int
bitCount(int x)
Deprecated.use Integer.bitCount() instead.static int
bitCount(long x)
static boolean
isBitSet(int[] a, int i)
static boolean
isValidBitIndex(int[] data, int i)
static void
setBit(int[] data, int i)
static void
unsetBit(int[] data, int i)
-
-
-
Field Detail
-
MASK_FIRST_SHORT
public static final long MASK_FIRST_SHORT
- See Also:
- Constant Field Values
-
MASK_SEC_SHORT
public static final long MASK_SEC_SHORT
- See Also:
- Constant Field Values
-
MASK_THIRD_SHORT
public static final long MASK_THIRD_SHORT
- See Also:
- Constant Field Values
-
MASK_FOURTH_SHORT
public static final long MASK_FOURTH_SHORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
bitCount
public static int bitCount(int x)
Deprecated.use Integer.bitCount() instead.The fastest Method (by Thomas Sander)- Parameters:
x
-- Returns:
-
bitCount
public static int bitCount(long x)
-
setBit
public static void setBit(int[] data, int i)
-
unsetBit
public static void unsetBit(int[] data, int i)
-
isBitSet
public static boolean isBitSet(int[] a, int i)
-
isValidBitIndex
public static boolean isValidBitIndex(int[] data, int i)
-
-