public final class Bitwise
extends java.lang.Object
Warning: This class is still under development.
| Modifier and Type | Method and Description |
|---|---|
static long |
and(long left,
long right)
This method performs a bitwise logical-AND.
|
static boolean |
get(long bits,
int index)
This method gets a single bit.
|
static long |
not(long bits)
This method performs a bitwise negation.
|
static long |
or(long left,
long right)
This method performs a bitwise logical-OR.
|
static long |
set(long bits,
int index,
boolean value)
This method sets a single bit.
|
static long |
shiftLeft(long bits,
int count)
This method performs a bitwise left-shift operation.
|
static long |
shiftRight(long bits,
int count)
This method performs a bitwise right-shift operation.
|
static long |
shiftRightUnsigned(long bits,
int count)
This method performs a bitwise unsigned-right-shift operation.
|
static long |
xor(long left,
long right)
This method performs a bitwise logical-XOR.
|
public static long shiftLeft(long bits,
int count)
bits - contains the bits to shift.count - is the distance of the shift.public static long shiftRight(long bits,
int count)
bits - contains the bits to shift.count - is the distance of the shift.public static long shiftRightUnsigned(long bits,
int count)
bits - contains the bits to shift.count - is the distance of the shift.public static long set(long bits,
int index,
boolean value)
bits - contains the bit to set.index - is the index of the bit to set.value - the new value of the bit.public static boolean get(long bits,
int index)
bits - contains the bit to get.index - is the index of the bit to get.public static long not(long bits)
bits - are the bits to negate.public static long and(long left,
long right)
left - is the left operand.left - is the right operand.public static long or(long left,
long right)
left - is the left operand.left - is the right operand.public static long xor(long left,
long right)
left - is the left operand.left - is the right operand.