Package io.github.jbellis.jvector.util
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 ClassesModifier and TypeInterfaceDescriptionstatic classBits with all bits set.static classBits with no bits set. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanget(int index) Returns the value of the bit with the specifiedindex.static BitsintersectionOf(Bits a, Bits b) Return a Bits that is set for a given ordinal iff both it is set in both `a` and `b`.static BitsReturns a Bits that is true when `bits` is false, and false when `bits` is trueintlength()Returns the number of bits in this set
-
Field Details
-
ALL
-
NONE
-
-
Method Details
-
get
boolean get(int index) Returns the value of the bit with the specifiedindex.- 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:
trueif the bit is set,falseotherwise.
-
length
int length()Returns the number of bits in this set -
inverseOf
Returns a Bits that is true when `bits` is false, and false when `bits` is true -
intersectionOf
Return a Bits that is set for a given ordinal iff both it is set in both `a` and `b`.
-