Class ConcurrentBitSet
java.lang.Object
java.util.BitSet
org.apache.pulsar.common.util.collections.ConcurrentBitSet
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
ConcurrentBitSetRecyclable
Safe multithreaded version of
BitSet.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConcurrentBitSet(int nbits) Creates a bit set whose initial size is large enough to explicitly represent bits with indices in the range0throughnbits-1. -
Method Summary
Modifier and TypeMethodDescriptionbooleanget(int bitIndex) booleanisEmpty()intnextClearBit(int fromIndex) intnextSetBit(int fromIndex) intpreviousClearBit(int fromIndex) intpreviousSetBit(int fromIndex) voidset(int bitIndex) voidset(int fromIndex, int toIndex)
-
Constructor Details
-
ConcurrentBitSet
public ConcurrentBitSet() -
ConcurrentBitSet
public ConcurrentBitSet(int nbits) Creates a bit set whose initial size is large enough to explicitly represent bits with indices in the range0throughnbits-1. All bits are initiallyfalse.- Parameters:
nbits- the initial size of the bit set- Throws:
NegativeArraySizeException- if the specified initial size is negative
-
-
Method Details
-
get
public boolean get(int bitIndex) -
set
public void set(int bitIndex) -
set
public void set(int fromIndex, int toIndex) -
nextSetBit
public int nextSetBit(int fromIndex) - Overrides:
nextSetBitin classBitSet
-
nextClearBit
public int nextClearBit(int fromIndex) - Overrides:
nextClearBitin classBitSet
-
previousSetBit
public int previousSetBit(int fromIndex) - Overrides:
previousSetBitin classBitSet
-
previousClearBit
public int previousClearBit(int fromIndex) - Overrides:
previousClearBitin classBitSet
-
isEmpty
public boolean isEmpty()
-