类 ConcurrentBitSet

java.lang.Object
java.util.BitSet
org.apache.pulsar.common.util.collections.ConcurrentBitSet
所有已实现的接口:
Serializable, Cloneable
直接已知子类:
ConcurrentBitSetRecyclable

public class ConcurrentBitSet extends BitSet
A BitSet that is protected by a StampedLock to provide thread-safe access. The BitSet.length() method is not thread safe and is not overridden because StampedLock is not reentrant. Use the safeLength() method to get the length of the bit set in a thread-safe manner.
另请参阅:
  • 构造器详细资料

    • 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.
      参数:
      nbits - the initial size of the bit set
      抛出:
      NegativeArraySizeException - if the specified initial size is negative
  • 方法详细资料

    • get

      public boolean get(int bitIndex)
      覆盖:
      get 在类中 BitSet
    • set

      public void set(int bitIndex)
      覆盖:
      set 在类中 BitSet
    • clear

      public void clear(int bitIndex)
      覆盖:
      clear 在类中 BitSet
    • set

      public void set(int fromIndex, int toIndex)
      覆盖:
      set 在类中 BitSet
    • clear

      public void clear(int fromIndex, int toIndex)
      覆盖:
      clear 在类中 BitSet
    • clear

      public void clear()
      覆盖:
      clear 在类中 BitSet
    • nextSetBit

      public int nextSetBit(int fromIndex)
      覆盖:
      nextSetBit 在类中 BitSet
    • nextClearBit

      public int nextClearBit(int fromIndex)
      覆盖:
      nextClearBit 在类中 BitSet
    • previousSetBit

      public int previousSetBit(int fromIndex)
      覆盖:
      previousSetBit 在类中 BitSet
    • previousClearBit

      public int previousClearBit(int fromIndex)
      覆盖:
      previousClearBit 在类中 BitSet
    • isEmpty

      public boolean isEmpty()
      覆盖:
      isEmpty 在类中 BitSet
    • cardinality

      public int cardinality()
      覆盖:
      cardinality 在类中 BitSet
    • size

      public int size()
      覆盖:
      size 在类中 BitSet
    • toByteArray

      public byte[] toByteArray()
      覆盖:
      toByteArray 在类中 BitSet
    • toLongArray

      public long[] toLongArray()
      覆盖:
      toLongArray 在类中 BitSet
    • flip

      public void flip(int bitIndex)
      覆盖:
      flip 在类中 BitSet
    • flip

      public void flip(int fromIndex, int toIndex)
      覆盖:
      flip 在类中 BitSet
    • set

      public void set(int bitIndex, boolean value)
      覆盖:
      set 在类中 BitSet
    • set

      public void set(int fromIndex, int toIndex, boolean value)
      覆盖:
      set 在类中 BitSet
    • get

      public BitSet get(int fromIndex, int toIndex)
      覆盖:
      get 在类中 BitSet
    • safeLength

      public int safeLength()
      Thread-safe version of length(). StampedLock is not reentrant and that's why the length() method is not overridden. Overriding length() method would require to use a reentrant lock which would be less performant.
      返回:
      length of the bit set
    • intersects

      public boolean intersects(BitSet set)
      覆盖:
      intersects 在类中 BitSet
    • and

      public void and(BitSet set)
      覆盖:
      and 在类中 BitSet
    • or

      public void or(BitSet set)
      覆盖:
      or 在类中 BitSet
    • xor

      public void xor(BitSet set)
      覆盖:
      xor 在类中 BitSet
    • andNot

      public void andNot(BitSet set)
      覆盖:
      andNot 在类中 BitSet
    • clone

      public Object clone()
      Returns the clone of the internal wrapped BitSet. This won't be a clone of the ConcurrentBitSet object.
      覆盖:
      clone 在类中 BitSet
      返回:
      a clone of the internal wrapped BitSet
    • toString

      public String toString()
      覆盖:
      toString 在类中 BitSet
    • stream

      public IntStream stream()
      This operation is not supported on ConcurrentBitSet.
      覆盖:
      stream 在类中 BitSet
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 BitSet
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 BitSet