Class Bits
java.lang.Object
com.ibm.wala.util.intset.Bits
utilities for manipulating values at the bit-level.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanfits(int val, int bits) Does an int literal val fit in bits bits?static intlower16(int value) Return the lower 16 bits (as an int) of an intstatic intlower32(long value) Return the lower 32 bits (as an int) of a longstatic intlower8(int value) Return the lower 8 bits (as an int) of an intstatic intpopulationCount(int value) Return the number of ones in the binary representation of an integer.static intupper16(int value) Return the upper 16 bits (as an int) of an intstatic intupper24(int value) Return the upper 24 bits (as an int) of an intstatic intupper32(long value) Return the upper 32 bits (as an int) of a long
-
Method Details
-
lower8
public static int lower8(int value) Return the lower 8 bits (as an int) of an int -
lower16
public static int lower16(int value) Return the lower 16 bits (as an int) of an int -
upper16
public static int upper16(int value) Return the upper 16 bits (as an int) of an int -
upper24
public static int upper24(int value) Return the upper 24 bits (as an int) of an int -
lower32
public static int lower32(long value) Return the lower 32 bits (as an int) of a long -
upper32
public static int upper32(long value) Return the upper 32 bits (as an int) of a long -
fits
public static boolean fits(int val, int bits) Does an int literal val fit in bits bits? -
populationCount
public static int populationCount(int value) Return the number of ones in the binary representation of an integer. Hank Warren's Hacker's Delight algorithm
-