public class OffheapBitSet extends Object implements 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)
returns the number of 64 bit words it would take to hold 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)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic long capacity()
public boolean get(long index)
IndexOutOfBoundsExceptionpublic 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 methodpublic void set(long index)
public void unsafeSet(long index)
public void clear(long index)
public void unsafeClear(long index)
public void clear()
protected long checkBounds(long index)
Copyright © 2019. All rights reserved.