Package org.apache.lucene.util
Class CombinedBitSet
java.lang.Object
org.apache.lucene.util.BitSet
org.apache.lucene.util.CombinedBitSet
- All Implemented Interfaces:
org.apache.lucene.util.Accountable
,org.apache.lucene.util.Bits
public final class CombinedBitSet
extends org.apache.lucene.util.BitSet
implements org.apache.lucene.util.Bits
A
BitSet
implementation that combines two instances of BitSet
and Bits
to provide a single merged view.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.lucene.util.Bits
org.apache.lucene.util.Bits.MatchAllBits, org.apache.lucene.util.Bits.MatchNoBits
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
Fields inherited from interface org.apache.lucene.util.Bits
EMPTY_ARRAY
-
Constructor Summary
ConstructorDescriptionCombinedBitSet(org.apache.lucene.util.BitSet first, org.apache.lucene.util.Bits second)
-
Method Summary
Modifier and TypeMethodDescriptionint
int
This implementation is slow and requires to iterate over all bits to compute the intersection.void
clear(int i)
void
clear(int startIndex, int endIndex)
boolean
get(int index)
org.apache.lucene.util.BitSet
getFirst()
int
length()
int
nextSetBit(int index)
int
prevSetBit(int index)
long
void
set(int i)
Methods inherited from class org.apache.lucene.util.BitSet
checkUnpositioned, of, or
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
CombinedBitSet
public CombinedBitSet(org.apache.lucene.util.BitSet first, org.apache.lucene.util.Bits second)
-
-
Method Details
-
getFirst
public org.apache.lucene.util.BitSet getFirst() -
cardinality
public int cardinality()This implementation is slow and requires to iterate over all bits to compute the intersection. UseapproximateCardinality()
for a fast approximation.- Specified by:
cardinality
in classorg.apache.lucene.util.BitSet
-
approximateCardinality
public int approximateCardinality()- Overrides:
approximateCardinality
in classorg.apache.lucene.util.BitSet
-
prevSetBit
public int prevSetBit(int index)- Specified by:
prevSetBit
in classorg.apache.lucene.util.BitSet
-
nextSetBit
public int nextSetBit(int index)- Specified by:
nextSetBit
in classorg.apache.lucene.util.BitSet
-
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsed
in interfaceorg.apache.lucene.util.Accountable
-
get
public boolean get(int index)- Specified by:
get
in interfaceorg.apache.lucene.util.Bits
-
length
public int length()- Specified by:
length
in interfaceorg.apache.lucene.util.Bits
-
set
public void set(int i)- Specified by:
set
in classorg.apache.lucene.util.BitSet
-
clear
public void clear(int i)- Specified by:
clear
in classorg.apache.lucene.util.BitSet
-
clear
public void clear(int startIndex, int endIndex)- Specified by:
clear
in classorg.apache.lucene.util.BitSet
-