Class ConcurrentBitSet

java.lang.Object
java.util.BitSet
org.apache.pulsar.common.util.collections.ConcurrentBitSet
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ConcurrentBitSetRecyclable

public class ConcurrentBitSet extends BitSet
Safe multithreaded version of BitSet.
See Also:
  • 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 range 0 through nbits-1. All bits are initially false.
      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)
      Overrides:
      get in class BitSet
    • set

      public void set(int bitIndex)
      Overrides:
      set in class BitSet
    • set

      public void set(int fromIndex, int toIndex)
      Overrides:
      set in class BitSet
    • nextSetBit

      public int nextSetBit(int fromIndex)
      Overrides:
      nextSetBit in class BitSet
    • nextClearBit

      public int nextClearBit(int fromIndex)
      Overrides:
      nextClearBit in class BitSet
    • previousSetBit

      public int previousSetBit(int fromIndex)
      Overrides:
      previousSetBit in class BitSet
    • previousClearBit

      public int previousClearBit(int fromIndex)
      Overrides:
      previousClearBit in class BitSet
    • isEmpty

      public boolean isEmpty()
      Overrides:
      isEmpty in class BitSet