Modifier and Type | Class and Description |
---|---|
static class |
MultiBits.SubResult
Represents a sub-Bits from
getMatchingSub() . |
Bits.MatchAllBits, Bits.MatchNoBits
Modifier and Type | Field and Description |
---|---|
private boolean |
defaultValue |
private int[] |
starts |
private Bits[] |
subs |
EMPTY_ARRAY
Constructor and Description |
---|
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 . |
MultiBits.SubResult |
getMatchingSub(ReaderSlice slice)
Returns a sub-Bits matching the provided
slice |
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
public MultiBits(Bits[] subs, int[] starts, boolean defaultValue)
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
public MultiBits.SubResult getMatchingSub(ReaderSlice slice)
slice
Because null
usually has a special meaning for
Bits (e.g. no deleted documents), you must check
MultiBits.SubResult.matches
instead to ensure the sub was
actually found.