static class Lucene54DocValuesProducer.SparseBits extends java.lang.Object implements Bits
Bits.MatchAllBits, Bits.MatchNoBits
Modifier and Type | Field and Description |
---|---|
(package private) long |
docId |
(package private) LongValues |
docIds |
(package private) long |
docIDsLength |
(package private) long |
firstDocId |
(package private) long |
index |
(package private) long |
maxDoc |
(package private) long |
nextDocId |
EMPTY_ARRAY
Constructor and Description |
---|
SparseBits(long maxDoc,
long docIDsLength,
LongValues docIDs) |
Modifier and Type | Method and Description |
---|---|
private void |
binarySearch(long hiIndex,
long docId) |
private boolean |
checkInvariants(long nextIndex,
long docId) |
private void |
exponentialSearch(long docId) |
private long |
gallop(long docId)
Gallop forward and stop as soon as an index is found that is greater than
the given docId.
|
boolean |
get(int index)
Returns the value of the bit with the specified
index . |
(package private) boolean |
get(long docId) |
int |
length()
Returns the number of bits in this set
|
private void |
reset() |
final long maxDoc
final long docIDsLength
final long firstDocId
final LongValues docIds
long index
long docId
long nextDocId
SparseBits(long maxDoc, long docIDsLength, LongValues docIDs)
private void reset()
private long gallop(long docId)
index
will store an index that stores a value
that is <= docId
while the return value will give an index
that stores a value that is > docId
. These indices can then be
used to binary search.private void binarySearch(long hiIndex, long docId)
private boolean checkInvariants(long nextIndex, long docId)
private void exponentialSearch(long docId)
boolean get(long docId)
public boolean get(int index)
Bits
index
.get
in interface Bits
index
- 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.