|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.esa.beam.util.BitSetter
public class BitSetter
Static function to manipulate bits inside an int or long.
| Constructor Summary | |
|---|---|
BitSetter()
|
|
| Method Summary | |
|---|---|
static boolean |
isFlagSet(int flags,
int bitIndex)
Tests if a flag with the given index is set in a 32-bit collection of flags. |
static boolean |
isFlagSet(long flags,
int bitIndex)
Tests if a flag with the given index is set in a 64-bit collection of flags. |
static int |
setFlag(int flags,
int bitIndex)
Sets a flag with the given index in a 32-bit collection of flags. |
static int |
setFlag(int flags,
int bitIndex,
boolean cond)
Sets a flag with the given index in a 32-bit collection of flags if a given condition is true. |
static long |
setFlag(long flags,
int bitIndex)
Sets a flag with the given index in a 64-bit collection of flags. |
static long |
setFlag(long flags,
int bitIndex,
boolean cond)
Sets a flag with the given index in a 64-bit collection of flags if a given condition is true. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BitSetter()
| Method Detail |
|---|
public static boolean isFlagSet(int flags,
int bitIndex)
flags - a collection of a maximum of 32 flagsbitIndex - the zero-based index of the flag to be tested
true if the flag is set
public static boolean isFlagSet(long flags,
int bitIndex)
flags - a collection of a maximum of 64 flagsbitIndex - the zero-based index of the flag to be tested
true if the flag is set
public static int setFlag(int flags,
int bitIndex)
flags - a collection of a maximum of 32 flagsbitIndex - the zero-based index of the flag to be set
public static long setFlag(long flags,
int bitIndex)
flags - a collection of a maximum of 64 flagsbitIndex - the zero-based index of the flag to be set
public static int setFlag(int flags,
int bitIndex,
boolean cond)
true.
flags - a collection of a maximum of 32 flagsbitIndex - the zero-based index of the flag to be setcond - the condition
public static long setFlag(long flags,
int bitIndex,
boolean cond)
true.
flags - a collection of a maximum of 64 flagsbitIndex - the zero-based index of the flag to be setcond - the condition
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||