|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.common.Bit
public final class Bit
Utility class containing numeric routines, especially bit operators.
Method Summary | |
---|---|
static boolean |
getBit(long input,
int bit)
Returns the value of a specific bit. |
static byte |
maskHighOrderBits(byte input)
Zeroes the 4 high-order bits in byte. |
static byte |
maskLowOrderBits(byte input)
Zeroes the 4 low-order bits in byte. |
static int |
setBit(int input,
int bit)
Turns a specific bit value "on". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int setBit(int input, int bit)
input
- The integer to be converted.bit
- The bit position to be set. Zero is the low-order bit.
public static boolean getBit(long input, int bit)
input
- The integer to be checked.bit
- The bit position to be checked. Zero is the low-order bit.
public static byte maskHighOrderBits(byte input)
input
- The byte for which the high-order bits should be masked.
public static byte maskLowOrderBits(byte input)
input
- The byte for which the low-order bits should be masked.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |