Class ConcurrentBitSet
- java.lang.Object
-
- java.util.BitSet
-
- org.apache.pulsar.common.util.collections.ConcurrentBitSet
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
ConcurrentBitSetRecyclable
public class ConcurrentBitSet extends java.util.BitSetSafe multithreaded version ofBitSet.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConcurrentBitSet()ConcurrentBitSet(int nbits)Creates a bit set whose initial size is large enough to explicitly represent bits with indices in the range0throughnbits-1.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanget(int bitIndex)booleanisEmpty()intnextClearBit(int fromIndex)intnextSetBit(int fromIndex)intpreviousClearBit(int fromIndex)intpreviousSetBit(int fromIndex)voidset(int bitIndex)voidset(int fromIndex, int toIndex)
-
-
-
Constructor Detail
-
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:
java.lang.NegativeArraySizeException- if the specified initial size is negative
-
-
Method Detail
-
get
public boolean get(int bitIndex)
- Overrides:
getin classjava.util.BitSet
-
set
public void set(int bitIndex)
- Overrides:
setin classjava.util.BitSet
-
set
public void set(int fromIndex, int toIndex)- Overrides:
setin classjava.util.BitSet
-
nextSetBit
public int nextSetBit(int fromIndex)
- Overrides:
nextSetBitin classjava.util.BitSet
-
nextClearBit
public int nextClearBit(int fromIndex)
- Overrides:
nextClearBitin classjava.util.BitSet
-
previousSetBit
public int previousSetBit(int fromIndex)
- Overrides:
previousSetBitin classjava.util.BitSet
-
previousClearBit
public int previousClearBit(int fromIndex)
- Overrides:
previousClearBitin classjava.util.BitSet
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmptyin classjava.util.BitSet
-
-