Package org.apache.lucene.index
Class MultiBits
- java.lang.Object
-
- org.apache.lucene.index.MultiBits
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.lucene.util.Bits
Bits.MatchAllBits, Bits.MatchNoBits
-
-
Field Summary
Fields Modifier and Type Field Description private booleandefaultValueprivate int[]startsprivate Bits[]subs-
Fields inherited from interface org.apache.lucene.util.Bits
EMPTY_ARRAY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancheckLength(int reader, int doc)booleanget(int doc)Returns the value of the bit with the specifiedindex.static BitsgetLiveDocs(IndexReader reader)Returns a singleBitsinstance for this reader, merging live Documents on the fly.intlength()Returns the number of bits in this setjava.lang.StringtoString()
-
-
-
Field Detail
-
subs
private final Bits[] subs
-
starts
private final int[] starts
-
defaultValue
private final boolean defaultValue
-
-
Constructor Detail
-
MultiBits
private MultiBits(Bits[] subs, int[] starts, boolean defaultValue)
-
-
Method Detail
-
getLiveDocs
public static Bits getLiveDocs(IndexReader reader)
Returns a singleBitsinstance 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.
-
checkLength
private boolean checkLength(int reader, int doc)
-
get
public boolean get(int doc)
Description copied from interface:BitsReturns the value of the bit with the specifiedindex.- Specified by:
getin interfaceBits- Parameters:
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!- Returns:
trueif the bit is set,falseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-