public class BitSetter extends Object
Constructor and Description |
---|
BitSetter() |
Modifier and Type | Method and Description |
---|---|
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 . |
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 testedtrue
if the flag is setpublic 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 testedtrue
if the flag is setpublic 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 setpublic 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 setpublic 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 conditionpublic 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 conditionCopyright © 2014–2017 European Space Agency (ESA). All rights reserved.