Class HugeAtomicBitSet


  • public final class HugeAtomicBitSet
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean allSet()
      Returns true iff all bits are set.
      long capacity()
      Returns the number of bits this bitset can hold.
      long cardinality()
      Returns the number of set bits in the bit set.
      void clear()
      Resets all bits in the bit set.
      void clear​(long index)
      Resets the bit at the given index.
      static HugeAtomicBitSet create​(long size, AllocationTracker tracker)  
      void flip​(long index)
      Toggles the bit at the given index.
      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.
      boolean isEmpty()
      Returns true iff no bit is set.
      void set​(long index)
      Sets the bit at the given index to true.
      void set​(long startIndex, long endIndex)
      Sets the bits from the startIndex (inclusive) to the endIndex (exclusive).
      long size()
      Returns the number of bits in the bitset.
      com.carrotsearch.hppc.BitSet toBitSet()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        public boolean get​(long index)
        Returns the state of the bit at the given index.
      • set

        public void set​(long index)
        Sets the bit at the given index to true.
      • set

        public void set​(long startIndex,
                        long endIndex)
        Sets the bits from the startIndex (inclusive) to the endIndex (exclusive).
      • getAndSet

        public boolean getAndSet​(long index)
        Sets a bit and returns the previous value. The index should be less than the BitSet size.
      • flip

        public void flip​(long index)
        Toggles the bit at the given index.
      • cardinality

        public long cardinality()
        Returns the number of set bits in the bit set.

        Note: this method is not thread-safe.

      • isEmpty

        public boolean isEmpty()
        Returns true iff no bit is set.

        Note: this method is not thread-safe.

      • allSet

        public boolean allSet()
        Returns true iff all bits are set.

        Note: this method is not thread-safe.

      • capacity

        public long capacity()
        Returns the number of bits this bitset can hold.
      • size

        public long size()
        Returns the number of bits in the bitset.
      • clear

        public void clear()
        Resets all bits in the bit set.

        Note: this method is not thread-safe.

      • clear

        public void clear​(long index)
        Resets the bit at the given index.
      • toBitSet

        public com.carrotsearch.hppc.BitSet toBitSet()