public abstract class BitSet extends Object implements MutableBits, Accountable
Bits.MatchAllBits, Bits.MatchNoBits
EMPTY_ARRAY
Constructor and Description |
---|
BitSet() |
Modifier and Type | Method and Description |
---|---|
int |
approximateCardinality()
Return an approximation of the cardinality of this set.
|
protected void |
assertUnpositioned(DocIdSetIterator iter)
Assert that the current doc is -1.
|
abstract int |
cardinality()
Return the number of bits that are set.
|
abstract void |
clear(int startIndex,
int endIndex)
Clears a range of bits.
|
abstract int |
nextSetBit(int index)
Returns the index of the first set bit starting at the index specified.
|
static BitSet |
of(DocIdSetIterator it,
int maxDoc)
Build a
BitSet from the content of the provided DocIdSetIterator . |
void |
or(DocIdSetIterator iter)
Does in-place OR of the bits provided by the iterator.
|
abstract int |
prevSetBit(int index)
Returns the index of the last set bit before or on the index specified.
|
abstract void |
set(int i)
Set the bit at
i . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear
getChildResources, ramBytesUsed
public static BitSet of(DocIdSetIterator it, int maxDoc) throws IOException
BitSet
from the content of the provided DocIdSetIterator
.
NOTE: this will fully consume the DocIdSetIterator
.IOException
public abstract void set(int i)
i
.public abstract void clear(int startIndex, int endIndex)
startIndex
- lower indexendIndex
- one-past the last bit to clearpublic abstract int cardinality()
public int approximateCardinality()
cardinality()
.public abstract int prevSetBit(int index)
public abstract int nextSetBit(int index)
DocIdSetIterator.NO_MORE_DOCS
is returned if there are no more set bits.protected final void assertUnpositioned(DocIdSetIterator iter)
public void or(DocIdSetIterator iter) throws IOException
IOException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.