Top Description Fields Constructors Methods
jogamp.common.util

public Class SyncedBitfield

extends Object
implements Bitfield
Class Inheritance
All Implemented Interfaces
com.jogamp.common.util.Bitfield
Imports
com.jogamp.common.util.Bitfield

Simple synchronized Bitfield by wrapping an existing Bitfield.

Field Summary

Modifier and TypeField and Description
private final Bitfield

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final synchronized int
bitCount()

Implements com.jogamp.common.util.Bitfield.bitCount.

Returns the number of one bits within this bitfield.
public final synchronized void
clear(final int
bit number, restricted to [0..size()-1].
bitnum
)

Implements com.jogamp.common.util.Bitfield.clear.

Clear the bit at position bitnum according to bit.
public final synchronized void
clearField(final boolean bit)

Implements com.jogamp.common.util.Bitfield.clearField.

Set all bits of this bitfield to the given value bit.
public final synchronized boolean
copy(final int
source bit number, restricted to [0..size()-1].
srcBitnum
,
final int
destination bit number, restricted to [0..size()-1].
dstBitnum
)

Implements com.jogamp.common.util.Bitfield.copy.

Copies the bit at position srcBitnum to position dstBitnum and returning true if the bit is set, otherwise false.
public final synchronized int
copy32(final int
source bit number, restricted to [0..size()-1].
srcLowBitnum
,
final int
destination bit number, restricted to [0..size()-1].
dstLowBitnum
,
final int length)

Implements com.jogamp.common.util.Bitfield.copy32.

Copies length bits at position srcLowBitnum to position dstLowBitnum and returning the bits.
public final synchronized boolean
get(final int
bit number, restricted to [0..size()-1].
bitnum
)

Implements com.jogamp.common.util.Bitfield.get.

Return true if the bit at position bitnum is set, otherwise false.
public final synchronized int
get32(final int
storage bit position of the lowest bit, restricted to [0..size()-length].
lowBitnum
,
final int
number of bits to read, constrained to [0..32].
length
)

Implements com.jogamp.common.util.Bitfield.get32.

Returns length bits from this storage, starting with the lowest bit from the storage position lowBitnum.
public final synchronized boolean
put(final int
bit number, restricted to [0..size()-1].
bitnum
,
final boolean bit)

Implements com.jogamp.common.util.Bitfield.put.

Set or clear the bit at position bitnum according to bit and return the previous value.
public final synchronized void
put32(final int
storage bit position of the lowest bit, restricted to [0..size()-length].
lowBitnum
,
final int
number of bits to write, constrained to [0..32].
length
,
final int
the actual bits to be put into this storage
data
)

Implements com.jogamp.common.util.Bitfield.put32.

Puts length bits of given data into this storage, starting w/ the lowest bit to the storage position lowBitnum.
public final synchronized void
set(final int
bit number, restricted to [0..size()-1].
bitnum
)

Implements com.jogamp.common.util.Bitfield.set.

Set the bit at position bitnum according to bit.
public final synchronized int
size()

Implements com.jogamp.common.util.Bitfield.size.

Returns the storage size in bit units, e.g. 32 bit for implementations using one int field.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

implback to summary
private final Bitfield impl

Constructor Detail

SyncedBitfieldback to summary
public SyncedBitfield(final Bitfield impl)

Method Detail

bitCountback to summary
public final synchronized int bitCount()

Implements com.jogamp.common.util.Bitfield.bitCount.

Doc from com.jogamp.common.util.Bitfield.bitCount.

Returns the number of one bits within this bitfield.

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

Annotations
@Override
clearback to summary
public final synchronized void clear(final int bitnum) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.clear.

Doc from com.jogamp.common.util.Bitfield.clear.

Clear the bit at position bitnum according to bit.

Parameters
bitnum:int

bit number, restricted to [0..size()-1].

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if bitnum is out of bounds
clearFieldback to summary
public final synchronized void clearField(final boolean bit)

Implements com.jogamp.common.util.Bitfield.clearField.

Doc from com.jogamp.common.util.Bitfield.clearField.

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

Annotations
@Override
copyback to summary
public final synchronized boolean copy(final int srcBitnum, final int dstBitnum) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.copy.

Doc from com.jogamp.common.util.Bitfield.copy.

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

Parameters
srcBitnum:int

source bit number, restricted to [0..size()-1].

dstBitnum:int

destination bit number, restricted to [0..size()-1].

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if bitnum is out of bounds
copy32back to summary
public final synchronized int copy32(final int srcLowBitnum, final int dstLowBitnum, final int length) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.copy32.

Doc from com.jogamp.common.util.Bitfield.copy32.

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
srcLowBitnum:int

source bit number, restricted to [0..size()-1].

dstLowBitnum:int

destination bit number, restricted to [0..size()-1].

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if bitnum is out of bounds
getback to summary
public final synchronized boolean get(final int bitnum) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.get.

Doc from com.jogamp.common.util.Bitfield.get.

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

Parameters
bitnum:int

bit number, restricted to [0..size()-1].

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if bitnum is out of bounds
get32back to summary
public final synchronized int get32(final int lowBitnum, final int length) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.get32.

Doc from com.jogamp.common.util.Bitfield.get32.

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

Parameters
lowBitnum:int

storage bit position of the lowest bit, restricted to [0..size()-length].

length:int

number of bits to read, constrained to [0..32].

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if rightBitnum is out of bounds
putback to summary
public final synchronized boolean put(final int bitnum, final boolean bit) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.put.

Doc from com.jogamp.common.util.Bitfield.put.

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

Parameters
bitnum:int

bit number, restricted to [0..size()-1].

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if bitnum is out of bounds
put32back to summary
public final synchronized void put32(final int lowBitnum, final int length, final int data) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.put32.

Doc from com.jogamp.common.util.Bitfield.put32.

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

Parameters
lowBitnum:int

storage bit position of the lowest bit, restricted to [0..size()-length].

length:int

number of bits to write, constrained to [0..32].

data:int

the actual bits to be put into this storage

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if rightBitnum is out of bounds
setback to summary
public final synchronized void set(final int bitnum) throws IndexOutOfBoundsException

Implements com.jogamp.common.util.Bitfield.set.

Doc from com.jogamp.common.util.Bitfield.set.

Set the bit at position bitnum according to bit.

Parameters
bitnum:int

bit number, restricted to [0..size()-1].

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if bitnum is out of bounds
sizeback to summary
public final synchronized int size()

Implements com.jogamp.common.util.Bitfield.size.

Doc from com.jogamp.common.util.Bitfield.size.

Returns the storage size in bit units, e.g. 32 bit for implementations using one int field.

Annotations
@Override