public class SparseFixedBitSet extends BitSet implements Bits, Accountable
i-th
long of the block is non-null, and its offset in the array of longs is
the number of one bits on the right of the i-th bit.Bits.MatchAllBits, Bits.MatchNoBitsEMPTY_ARRAYNULL_ACCOUNTABLE| Constructor and Description |
|---|
SparseFixedBitSet(int length)
|
| Modifier and Type | Method and Description |
|---|---|
int |
approximateCardinality()
Return an approximation of the cardinality of this set.
|
int |
cardinality()
Return the number of bits that are set.
|
void |
clear(int i)
Clear the bit at index i.
|
void |
clear(int from,
int to)
Clears a range of bits.
|
boolean |
get(int i)
Returns the value of the bit with the specified
index. |
int |
length()
Returns the number of bits in this set
|
int |
nextSetBit(int i)
Returns the index of the first set bit starting at the index specified.
|
void |
or(DocIdSetIterator it)
Does in-place OR of the bits provided by the iterator.
|
int |
prevSetBit(int i)
Returns the index of the last set bit before or on the index specified.
|
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
void |
set(int i)
Set the bit at index i.
|
String |
toString() |
checkUnpositioned, ofclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildResourcespublic int length()
Bitspublic int cardinality()
BitSetcardinality in class BitSetpublic int approximateCardinality()
BitSetBitSet.cardinality().approximateCardinality in class BitSetpublic boolean get(int i)
Bitsindex.get in interface Bitsi - index, should be non-negative and < Bits.length().
The result of passing negative or out of bounds values is undefined
by this interface, just don't do it!true if the bit is set, false otherwise.public void clear(int from,
int to)
BitSetpublic int nextSetBit(int i)
BitSetDocIdSetIterator.NO_MORE_DOCS is returned if there are no more set bits.nextSetBit in class BitSetpublic int prevSetBit(int i)
BitSetprevSetBit in class BitSetpublic void or(DocIdSetIterator it) throws IOException
BitSetor in class BitSetIOExceptionpublic long ramBytesUsed()
AccountableramBytesUsed in interface AccountableCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.