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 longMASK_FIRST_SHORTstatic longMASK_FOURTH_SHORTstatic longMASK_SEC_SHORTstatic longMASK_THIRD_SHORT
-
Constructor Summary
Constructors Constructor Description BitUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intbitCount(int x)Deprecated.use Integer.bitCount() instead.static intbitCount(long x)static booleanisBitSet(int[] a, int i)static booleanisValidBitIndex(int[] data, int i)static voidsetBit(int[] data, int i)static voidunsetBit(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)
-
-