Package org.neo4j.gds.core.utils.paged
Class HugeAtomicGrowingBitSet
- java.lang.Object
-
- org.neo4j.gds.core.utils.paged.HugeAtomicGrowingBitSet
-
public final class HugeAtomicGrowingBitSet extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
capacity()
The current capacity of the bit set.long
cardinality()
Returns the number of set bits in the bit set.void
clear(long index)
Resets the bit at the given index.static HugeAtomicGrowingBitSet
create(long bitSize)
void
forEachSetBit(java.util.function.LongConsumer consumer)
Iterates the bit set in increasing index order and calls the given consumer for each index with a set bit.boolean
get(long index)
Returns the state of the bit at the given index.boolean
getAndSet(long index)
Sets a bit and returns the previous value.void
set(long index)
Sets the bit at the given index to true.
-
-
-
Method Detail
-
create
public static HugeAtomicGrowingBitSet create(long bitSize)
-
set
public void set(long index)
Sets the bit at the given index to true.
-
get
public boolean get(long index)
Returns the state of the bit at the given index.
-
getAndSet
public boolean getAndSet(long index)
Sets a bit and returns the previous value. The index should be less than the BitSet size.
-
cardinality
public long cardinality()
Returns the number of set bits in the bit set.The result of the method does not include the effects of concurrent write operations that occur while the cardinality is computed.
-
forEachSetBit
public void forEachSetBit(java.util.function.LongConsumer consumer)
Iterates the bit set in increasing index order and calls the given consumer for each index with a set bit.The result of the method does not include the effects of concurrent write operations that occur while the bit set if traversed.
-
clear
public void clear(long index)
Resets the bit at the given index.
-
capacity
public long capacity()
The current capacity of the bit set. Setting a bit at an index exceeding the capacity, leads to a resize operation. The cardinality is a multiple of the underling page size: 2^PAGE_SHIFT_BITS
.
-
-