An iterator to iterate over set bits in an OpenBitSet. This is faster than nextSetBit() for iterating over the complete set of bits, especially when the density of the bits set is high.
More...
#include <OpenBitSetIterator.h>
|
static const int32_t | bitlist [] |
| The General Idea: instead of having an array per byte that has the offsets of the next set bit, that array could be packed inside a 32 bit integer (8 4 bit numbers). That should be faster than accessing an array for each index, and the total array size is kept smaller (256*sizeof(int32_t))=1K.
|
|
An iterator to iterate over set bits in an OpenBitSet. This is faster than nextSetBit() for iterating over the complete set of bits, especially when the density of the bits set is high.
◆ OpenBitSetIterator() [1/2]
Lucene::OpenBitSetIterator::OpenBitSetIterator |
( |
const OpenBitSetPtr & |
bitSet | ) |
|
◆ OpenBitSetIterator() [2/2]
Lucene::OpenBitSetIterator::OpenBitSetIterator |
( |
LongArray |
bits, |
|
|
int32_t |
numWords |
|
) |
| |
◆ ~OpenBitSetIterator()
virtual Lucene::OpenBitSetIterator::~OpenBitSetIterator |
( |
| ) |
|
|
virtual |
◆ _getClassName()
static String Lucene::OpenBitSetIterator::_getClassName |
( |
| ) |
|
|
inlinestatic |
◆ advance()
virtual int32_t Lucene::OpenBitSetIterator::advance |
( |
int32_t |
target | ) |
|
|
virtual |
Advances to the first beyond the current whose document number is greater than or equal to target. Returns the current document number or NO_MORE_DOCS
if there are no more docs in the set.
Behaves as if written:
int32_t advance(int32_t target)
{
int32_t doc;
while ((doc = nextDoc()) < target)
{ }
return doc;
}
Some implementations are considerably more efficient than that.
NOTE: certain implementations may return a different value (each time) if called several times in a row with the same target.
NOTE: this method may be called with {@value NO_MORE_DOCS} for efficiency by some Scorers. If your implementation cannot efficiently determine that it should exhaust, it is recommended that you check for that value in each call to this method.
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behaviour.
Implements Lucene::DocIdSetIterator.
◆ docID()
virtual int32_t Lucene::OpenBitSetIterator::docID |
( |
| ) |
|
|
virtual |
◆ getClassName()
virtual String Lucene::OpenBitSetIterator::getClassName |
( |
| ) |
|
|
inlinevirtual |
◆ nextDoc()
virtual int32_t Lucene::OpenBitSetIterator::nextDoc |
( |
| ) |
|
|
virtual |
Advances to the next document in the set and returns the doc it is currently on, or NO_MORE_DOCS
if there are no more docs in the set.
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behaviour.
Implements Lucene::DocIdSetIterator.
◆ shared_from_this()
◆ shift()
void Lucene::OpenBitSetIterator::shift |
( |
| ) |
|
|
protected |
◆ arr
LongArray Lucene::OpenBitSetIterator::arr |
|
protected |
◆ bitlist
const int32_t Lucene::OpenBitSetIterator::bitlist[] |
|
staticprotected |
The General Idea: instead of having an array per byte that has the offsets of the next set bit, that array could be packed inside a 32 bit integer (8 4 bit numbers). That should be faster than accessing an array for each index, and the total array size is kept smaller (256*sizeof(int32_t))=1K.
◆ curDocId
int32_t Lucene::OpenBitSetIterator::curDocId |
|
protected |
int32_t Lucene::OpenBitSetIterator::i |
|
protected |
◆ indexArray
int32_t Lucene::OpenBitSetIterator::indexArray |
|
protected |
◆ word
int64_t Lucene::OpenBitSetIterator::word |
|
protected |
◆ words
int32_t Lucene::OpenBitSetIterator::words |
|
protected |
◆ wordShift
int32_t Lucene::OpenBitSetIterator::wordShift |
|
protected |
The documentation for this class was generated from the following file: