Bits.MatchAllBits, Bits.MatchNoBits
Modifier and Type | Field and Description |
---|---|
private boolean |
defaultValue |
private int[] |
starts |
private Bits[] |
subs |
EMPTY_ARRAY
Modifier | Constructor and Description |
---|---|
private |
MultiBits(Bits[] subs,
int[] starts,
boolean defaultValue) |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkLength(int reader,
int doc) |
boolean |
get(int doc)
Returns the value of the bit with the specified
index . |
static Bits |
getLiveDocs(IndexReader reader)
Returns a single
Bits instance for this
reader, merging live Documents on the
fly. |
int |
length()
Returns the number of bits in this set
|
java.lang.String |
toString() |
private final Bits[] subs
private final int[] starts
private final boolean defaultValue
private MultiBits(Bits[] subs, int[] starts, boolean defaultValue)
public static Bits getLiveDocs(IndexReader reader)
Bits
instance for this
reader, merging live Documents on the
fly. This method will return null if the reader
has no deletions.
NOTE: this is a very slow way to access live docs. For example, each Bits access will require a binary search. It's better to get the sub-readers and iterate through them yourself.
private boolean checkLength(int reader, int doc)
public boolean get(int doc)
Bits
index
.get
in interface Bits
doc
- 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 java.lang.String toString()
toString
in class java.lang.Object