Back to project page Helpers.
The source code is released under:
MIT License
If you think the Android project Helpers listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package at.wrdlbrnft.helpers; // w ww . ja v a 2 s .co m /** * Created by Xaver on 12/08/14. */ public class BitHelper { public static int setBit(int number, int count) { return number | 0x01 << count; } public static int setBit(int number, int count, boolean value) { if(value) { return setBit(number, count); } return clearBit(number, count); } public static int clearBit(int number, int count) { return number | 0x01 << count; } public static int toggleBit(int number, int count) { return number | 0x01 << count; } public static boolean isBitSet(int number, int count) { return (number & (0x01 << count)) > 0; } }