Interface Bits

All Known Implementing Classes:
AtomicFixedBitSet, Bits.MatchAllBits, Bits.MatchNoBits, BitSet, FixedBitSet, GrowableBitSet, SparseFixedBitSet, SynchronizedGrowableBitSet

public interface Bits
Interface for Bitset-like structures.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Bits with all bits set.
    static class 
    Bits with no bits set.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Bits
     
    static final Bits
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    get(int index)
    Returns the value of the bit with the specified index.
    static Bits
    Return a Bits that is set for a given ordinal iff both it is set in both `a` and `b`.
    static Bits
    Returns a Bits that is true when `bits` is false, and false when `bits` is true
    int
    Returns the number of bits in this set
  • Field Details

    • ALL

      static final Bits ALL
    • NONE

      static final Bits NONE
  • Method Details

    • get

      boolean get(int index)
      Returns the value of the bit with the specified index.
      Parameters:
      index - index, should be non-negative and < length(). The result of passing negative or out of bounds values is undefined by this interface, just don't do it!
      Returns:
      true if the bit is set, false otherwise.
    • length

      int length()
      Returns the number of bits in this set
    • inverseOf

      static Bits inverseOf(Bits bits)
      Returns a Bits that is true when `bits` is false, and false when `bits` is true
    • intersectionOf

      static Bits intersectionOf(Bits a, Bits b)
      Return a Bits that is set for a given ordinal iff both it is set in both `a` and `b`.