Class ConcurrentBitSet

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    ConcurrentBitSetRecyclable

    public class ConcurrentBitSet
    extends java.util.BitSet
    Safe multithreaded version of BitSet.
    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 range 0 through nbits-1.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean get​(int bitIndex)  
      boolean isEmpty()  
      int nextClearBit​(int fromIndex)  
      int nextSetBit​(int fromIndex)  
      int previousClearBit​(int fromIndex)  
      int previousSetBit​(int fromIndex)  
      void set​(int bitIndex)  
      void set​(int fromIndex, int toIndex)  
      • Methods inherited from class java.util.BitSet

        and, andNot, cardinality, clear, clear, clear, clone, equals, flip, flip, get, hashCode, intersects, length, or, set, set, size, stream, toByteArray, toLongArray, toString, valueOf, valueOf, valueOf, valueOf, xor
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 range 0 through nbits-1. All bits are initially false.
        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:
        get in class java.util.BitSet
      • set

        public void set​(int bitIndex)
        Overrides:
        set in class java.util.BitSet
      • set

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

        public int nextSetBit​(int fromIndex)
        Overrides:
        nextSetBit in class java.util.BitSet
      • nextClearBit

        public int nextClearBit​(int fromIndex)
        Overrides:
        nextClearBit in class java.util.BitSet
      • previousSetBit

        public int previousSetBit​(int fromIndex)
        Overrides:
        previousSetBit in class java.util.BitSet
      • previousClearBit

        public int previousClearBit​(int fromIndex)
        Overrides:
        previousClearBit in class java.util.BitSet
      • isEmpty

        public boolean isEmpty()
        Overrides:
        isEmpty in class java.util.BitSet