public class OffheapBitSet
extends java.lang.Object
implements java.io.Closeable
BitSet| Modifier and Type | Field and Description |
|---|---|
protected long |
baseAddr |
protected long |
size |
| Constructor and Description |
|---|
OffheapBitSet(long numBits) |
OffheapBitSet(long address,
long sizeBytes) |
| Modifier and Type | Method and Description |
|---|---|
static long |
bits2words(long numBits) |
long |
capacity() |
protected long |
checkBounds(long index) |
void |
clear() |
void |
clear(long index)
clears the bit.
|
void |
close() |
boolean |
get(long index)
Returns true or false for the specified bit index.
|
void |
set(long index)
Sets the bit at the specified index.
|
void |
unsafeClear(long index) |
boolean |
unsafeGet(long index)
Same as
get(long) but does not check for index within capacity
bounds. |
void |
unsafeSet(long index) |
public OffheapBitSet(long numBits)
public OffheapBitSet(long address,
long sizeBytes)
public static long bits2words(long numBits)
numBits - a number of bits to holdpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic long capacity()
public boolean get(long index)
index - the bit indexjava.lang.IndexOutOfBoundsException - if the index is out of rangepublic boolean unsafeGet(long index)
get(long) but does not check for index within capacity
bounds. This allows to make it few ticks faster in exchange to seg fault
possibility. Use when going out of capacity is ensured by other means
outside of this methodindex - a bit indexpublic void set(long index)
index - a bit indexjava.lang.IndexOutOfBoundsException - if the index is out of rangepublic void unsafeSet(long index)
public void clear(long index)
index - a bit indexpublic void unsafeClear(long index)
public void clear()
protected long checkBounds(long index)