jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Public Member Functions | List of all members
jau.util.Int32ArrayBitfield Class Reference

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

Inheritance diagram for jau.util.Int32ArrayBitfield:
Collaboration diagram for jau.util.Int32ArrayBitfield:

Public Member Functions

 Int32ArrayBitfield (final int storageBitSize)
 
int size ()
 Returns the storage size in bit units, e.g. More...
 
final void clearField (final boolean bit)
 Set all bits of this bitfield to the given value bit. More...
 
final 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...
 
final 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...
 
final int copy32 (final int srcBitnum, final int dstBitnum, final int length) throws IndexOutOfBoundsException
 Copies length bits at position srcLowBitnum to position dstLowBitnum and returning the bits. More...
 
final boolean get (final int bitnum) throws IndexOutOfBoundsException
 Return true if the bit at position bitnum is set, otherwise false. More...
 
final 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...
 
final void set (final int bitnum) throws IndexOutOfBoundsException
 Set the bit at position bitnum according to bit. More...
 
final void clear (final int bitnum) throws IndexOutOfBoundsException
 Clear the bit at position bitnum according to bit. More...
 
final 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...
 
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...
 

Detailed Description

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

Implementation uses a 32bit integer array for storage.

Definition at line 37 of file Int32ArrayBitfield.java.

Constructor & Destructor Documentation

◆ Int32ArrayBitfield()

jau.util.Int32ArrayBitfield.Int32ArrayBitfield ( final int  storageBitSize)
Parameters
storageBitSize

Definition at line 45 of file Int32ArrayBitfield.java.

Member Function Documentation

◆ bitCount()

int jau.util.Int32ArrayBitfield.bitCount ( )

Returns the number of one bits within this bitfield.

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

Implements org.jau.util.Bitfield.

Definition at line 199 of file Int32ArrayBitfield.java.

Here is the call graph for this function:

◆ clear()

final void jau.util.Int32ArrayBitfield.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

Implements org.jau.util.Bitfield.

Definition at line 168 of file Int32ArrayBitfield.java.

◆ clearField()

final void jau.util.Int32ArrayBitfield.clearField ( final boolean  bit)

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

Implements org.jau.util.Bitfield.

Definition at line 57 of file Int32ArrayBitfield.java.

◆ copy()

final boolean jau.util.Int32ArrayBitfield.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

Implements org.jau.util.Bitfield.

Definition at line 176 of file Int32ArrayBitfield.java.

◆ copy32()

final int jau.util.Int32ArrayBitfield.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)

Implements org.jau.util.Bitfield.

Definition at line 129 of file Int32ArrayBitfield.java.

Here is the call graph for this function:

◆ get()

final boolean jau.util.Int32ArrayBitfield.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

Implements org.jau.util.Bitfield.

Definition at line 136 of file Int32ArrayBitfield.java.

◆ get32()

final int jau.util.Int32ArrayBitfield.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)

Implements org.jau.util.Bitfield.

Definition at line 76 of file Int32ArrayBitfield.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ put()

final boolean jau.util.Int32ArrayBitfield.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

Implements org.jau.util.Bitfield.

Definition at line 144 of file Int32ArrayBitfield.java.

◆ put32()

final void jau.util.Int32ArrayBitfield.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)

Implements org.jau.util.Bitfield.

Definition at line 102 of file Int32ArrayBitfield.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set()

final void jau.util.Int32ArrayBitfield.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

Implements org.jau.util.Bitfield.

Definition at line 160 of file Int32ArrayBitfield.java.

◆ size()

int jau.util.Int32ArrayBitfield.size ( )

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

32 bit for implementations using one int field.

Implements org.jau.util.Bitfield.

Definition at line 52 of file Int32ArrayBitfield.java.


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