FixedBitSet
BitSet of fixed length (numBits), backed by accessible (.getBits) long[], accessed with an int index, implementing Bits and DocIdSet. If you need to manage more than 2.1B bits, use LongBitSet.
Constructors
Creates a new FixedBitSet. The internally allocated long array will be exactly the size needed to accommodate the numBits specified.
Creates a new FixedBitSet using the provided long[] array as backing store. The storedBits array must be large enough to accommodate the numBits specified, but may be larger. In that case the 'extra' or 'ghost' bits must be clear (or they may provoke spurious side-effects)
Properties
Functions
this = this AND other
Apply this Bits instance to the given FixedBitSet, which starts at the given offset.
Return an approximation of the cardinality of this set. Some implementations may trade accuracy for speed if they have the ability to estimate the cardinality of the set without iterating over all the data. The default implementation returns .cardinality.
Convert this instance to read-only Bits. This is useful in the case that this [ ] is returned as a Bits instance, to make sure that consumers may not get write access back by casting to a FixedBitSet. NOTE: Changes to this [ ] will be reflected on the returned Bits.
Returns number of set bits. NOTE: this visits every long in the backing bits array, and the result is not internally cached!
returns true if the sets have any elements in common
Does in-place OR of the bits provided by the iterator. The state of the iterator after this operation terminates is undefined.
this = this OR other
Returns the index of the last set bit before or on the index specified. -1 is returned if there are no more set bits.
Return the memory usage of this object in bytes. Negative values are illegal.
Scans the backing store to check if all bits are clear. The method is deliberately not called "isEmpty" to emphasize it is not low cost (as isEmpty usually is).
Does in-place XOR of the bits provided by the iterator.
this = this XOR other