GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.Bitfield Interface Reference

Simple bitfield interface for efficient bit storage access in O(1). More...

Collaboration diagram for com.jogamp.common.util.Bitfield:

Classes

class  Factory
 Simple Bitfield factory for returning the efficient implementation. More...
 
class  Util
 Bit operation utilities (static). More...
 

Public Member Functions

int size ()
 Returns the storage size in bit units, e.g. More...
 
void clearField (final boolean bit)
 Set all bits of this bitfield to the given value bit. More...
 
int get32 (final int lowBitnum, final int length) throws IndexOutOfBoundsException
 Returns length bits from this storage, starting with the lowest bit from the storage position lowBitnum. More...
 
void put32 (final int lowBitnum, final int length, final int data) throws IndexOutOfBoundsException
 Puts length bits of given data into this storage, starting w/ the lowest bit to the storage position lowBitnum. More...
 
int copy32 (final int srcLowBitnum, final int dstLowBitnum, final int length) throws IndexOutOfBoundsException
 Copies length bits at position srcLowBitnum to position dstLowBitnum and returning the bits. More...
 
boolean get (final int bitnum) throws IndexOutOfBoundsException
 Return true if the bit at position bitnum is set, otherwise false. More...
 
boolean put (final int bitnum, final boolean bit) throws IndexOutOfBoundsException
 Set or clear the bit at position bitnum according to bit and return the previous value. More...
 
void set (final int bitnum) throws IndexOutOfBoundsException
 Set the bit at position bitnum according to bit. More...
 
void clear (final int bitnum) throws IndexOutOfBoundsException
 Clear the bit at position bitnum according to bit. More...
 
boolean copy (final int srcBitnum, final int dstBitnum) throws IndexOutOfBoundsException
 Copies the bit at position srcBitnum to position dstBitnum and returning true if the bit is set, otherwise false. More...
 
int bitCount ()
 Returns the number of one bits within this bitfield. More...
 

Static Public Attributes

static final int UNSIGNED_INT_MAX_VALUE = 0xffffffff
 Maximum 32 bit Unsigned Integer Value: 0xffffffff == {@value}. More...
 

Detailed Description

Simple bitfield interface for efficient bit storage access in O(1).

Since
2.3.2

Definition at line 36 of file Bitfield.java.

Member Function Documentation

◆ bitCount()

int com.jogamp.common.util.Bitfield.bitCount ( )

Returns the number of one bits within this bitfield.

Utilizes {#link Bitfield.Util#bitCount(int)}.

Here is the caller graph for this function:

◆ clear()

void com.jogamp.common.util.Bitfield.clear ( final int  bitnum) throws IndexOutOfBoundsException

Clear the bit at position bitnum according to bit.

Parameters
bitnumbit number, restricted to [0..size()-1].
Exceptions
IndexOutOfBoundsExceptionif bitnum is out of bounds

◆ clearField()

void com.jogamp.common.util.Bitfield.clearField ( final boolean  bit)

Set all bits of this bitfield to the given value bit.

Here is the caller graph for this function:

◆ copy()

boolean com.jogamp.common.util.Bitfield.copy ( final int  srcBitnum,
final int  dstBitnum 
) throws IndexOutOfBoundsException

Copies the bit at position srcBitnum to position dstBitnum and returning true if the bit is set, otherwise false.

Parameters
srcBitnumsource bit number, restricted to [0..size()-1].
dstBitnumdestination bit number, restricted to [0..size()-1].
Exceptions
IndexOutOfBoundsExceptionif bitnum is out of bounds

◆ copy32()

int com.jogamp.common.util.Bitfield.copy32 ( final int  srcLowBitnum,
final int  dstLowBitnum,
final int  length 
) throws IndexOutOfBoundsException

Copies length bits at position srcLowBitnum to position dstLowBitnum and returning the bits.

Implementation shall operate as if invoking get32(int, int) and then put32(int, int, int) sequentially.

Parameters
srcLowBitnumsource bit number, restricted to [0..size()-1].
dstLowBitnumdestination bit number, restricted to [0..size()-1].
Exceptions
IndexOutOfBoundsExceptionif bitnum is out of bounds
See also
get32(int, int)
put32(int, int, int)

◆ get()

boolean com.jogamp.common.util.Bitfield.get ( final int  bitnum) throws IndexOutOfBoundsException

Return true if the bit at position bitnum is set, otherwise false.

Parameters
bitnumbit number, restricted to [0..size()-1].
Exceptions
IndexOutOfBoundsExceptionif bitnum is out of bounds

◆ get32()

int com.jogamp.common.util.Bitfield.get32 ( final int  lowBitnum,
final int  length 
) throws IndexOutOfBoundsException

Returns length bits from this storage, starting with the lowest bit from the storage position lowBitnum.

Parameters
lowBitnumstorage bit position of the lowest bit, restricted to [0..size()-length].
lengthnumber of bits to read, constrained to [0..32].
Exceptions
IndexOutOfBoundsExceptionif rightBitnum is out of bounds
See also
put32(int, int, int)

◆ put()

boolean com.jogamp.common.util.Bitfield.put ( final int  bitnum,
final boolean  bit 
) throws IndexOutOfBoundsException

Set or clear the bit at position bitnum according to bit and return the previous value.

Parameters
bitnumbit number, restricted to [0..size()-1].
Exceptions
IndexOutOfBoundsExceptionif bitnum is out of bounds

◆ put32()

void com.jogamp.common.util.Bitfield.put32 ( final int  lowBitnum,
final int  length,
final int  data 
) throws IndexOutOfBoundsException

Puts length bits of given data into this storage, starting w/ the lowest bit to the storage position lowBitnum.

Parameters
lowBitnumstorage bit position of the lowest bit, restricted to [0..size()-length].
lengthnumber of bits to write, constrained to [0..32].
datathe actual bits to be put into this storage
Exceptions
IndexOutOfBoundsExceptionif rightBitnum is out of bounds
See also
get32(int, int)

◆ set()

void com.jogamp.common.util.Bitfield.set ( final int  bitnum) throws IndexOutOfBoundsException

Set the bit at position bitnum according to bit.

Parameters
bitnumbit number, restricted to [0..size()-1].
Exceptions
IndexOutOfBoundsExceptionif bitnum is out of bounds

◆ size()

int com.jogamp.common.util.Bitfield.size ( )

Returns the storage size in bit units, e.g.

32 bit for implementations using one int field.

Here is the caller graph for this function:

Member Data Documentation

◆ UNSIGNED_INT_MAX_VALUE

final int com.jogamp.common.util.Bitfield.UNSIGNED_INT_MAX_VALUE = 0xffffffff
static

Maximum 32 bit Unsigned Integer Value: 0xffffffff == {@value}.

Definition at line 38 of file Bitfield.java.


The documentation for this interface was generated from the following file: