public class OpenBitSetIterator extends DocIdSetIterator
| Modifier and Type | Field and Description |
|---|---|
protected static int[] |
bitlist |
| Constructor and Description |
|---|
OpenBitSetIterator(long[] bits,
int numWords) |
OpenBitSetIterator(OpenBitSet obs) |
| Modifier and Type | Method and Description |
|---|---|
int |
doc()
Returns the current document number.
|
boolean |
next()
alternate shift implementations
// 32 bit shifts, but a long shift needed at the end
private void shift2() {
int y = (int)word;
if (y==0) {wordShift +=32; y = (int)(word >>>32); }
if ((y & 0x0000FFFF) == 0) { wordShift +=16; y>>>=16; }
if ((y & 0x000000FF) == 0) { wordShift +=8; y>>>=8; }
indexArray = bitlist[y & 0xff];
word >>>= (wordShift +1);
}
private void shift3() {
int lower = (int)word;
int lowByte = lower & 0xff;
if (lowByte != 0) {
indexArray=bitlist[lowByte];
return;
}
shift();
}
|
boolean |
skipTo(int target)
Skips entries to the first beyond the current whose document number is
greater than or equal to target.
|
public OpenBitSetIterator(OpenBitSet obs)
public OpenBitSetIterator(long[] bits,
int numWords)
public boolean next()
next in class DocIdSetIteratorpublic boolean skipTo(int target)
DocIdSetIteratorReturns true iff there is such an entry.
Behaves as if written:
boolean skipTo(int target) {
do {
if (!next())
return false;
} while (target > doc());
return true;
}
Some implementations are considerably more efficient than that.skipTo in class DocIdSetIteratorpublic int doc()
DocIdSetIterator This is invalid until DocIdSetIterator.next() is called for the first time.
doc in class DocIdSetIteratorCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.