Package com.jogamp.common.util
Class IntBitfield
- java.lang.Object
-
- com.jogamp.common.util.IntBitfield
-
public class IntBitfield extends Object
Deprecated.UseBitfield
implementations viaBitfield.Factory.create(int)
.Simple bitfield holder class using an int[] storage.
IntBitfield allows convenient access of a wide field of transient bits using efficient storage in O(1).
It can be used e.g. to map key-codes to pressed-state etc.
-
-
Field Summary
Fields Modifier and Type Field Description static int
UNIT_SIZE
Deprecated.Unit size in bits, here 32 bits for one int unit.
-
Constructor Summary
Constructors Constructor Description IntBitfield(int bitCount)
Deprecated.IntBitfield(long bitCount)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
capacity()
Deprecated.Return the capacity of this bit field, i.e.boolean
get(int bitnum)
Deprecated.Returntrue
if the bit at positionbitnum
is set, otherwisefalse
.boolean
get(long bitnum)
Deprecated.Returntrue
if the bit at positionbitnum
is set, otherwisefalse
.long
getBitCount()
Deprecated.Returns the number of set bits within this bitfield.static int
getBitCount(int n)
Deprecated.boolean
put(int bitnum, boolean bit)
Deprecated.Set or clear the bit at positionbitnum
according tobit
and return the previous value.boolean
put(long bitnum, boolean bit)
Deprecated.Set or clear the bit at positionbitnum
according tobit
and return the previous value.
-
-
-
Field Detail
-
UNIT_SIZE
public static final int UNIT_SIZE
Deprecated.Unit size in bits, here 32 bits for one int unit.- See Also:
- Constant Field Values
-
-
Method Detail
-
capacity
public final long capacity()
Deprecated.Return the capacity of this bit field, i.e. the number of bits stored int this field.
-
get
public final boolean get(long bitnum)
Deprecated.Returntrue
if the bit at positionbitnum
is set, otherwisefalse
.
-
get
public final boolean get(int bitnum)
Deprecated.Returntrue
if the bit at positionbitnum
is set, otherwisefalse
.
-
put
public final boolean put(long bitnum, boolean bit)
Deprecated.Set or clear the bit at positionbitnum
according tobit
and return the previous value.
-
put
public final boolean put(int bitnum, boolean bit)
Deprecated.Set or clear the bit at positionbitnum
according tobit
and return the previous value.
-
getBitCount
public static final int getBitCount(int n)
Deprecated.
-
getBitCount
public long getBitCount()
Deprecated.Returns the number of set bits within this bitfield.Utilizes {#link
getBitCount(int)
}.
-
-