|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.DocIdSet
org.apache.lucene.util.OpenBitSet
org.apache.solr.util.OpenBitSet
OpenBitSet
directly.
public class OpenBitSet
An "open" BitSet implementation that allows direct access to the array of words storing the bits.
Unlike java.util.bitet, the fact that bits are packed into an array of longs is part of the interface. This allows efficient implementation of other algorithms by someone other than the author. It also allows one to efficiently implement alternate serialization or interchange formats.OpenBitSet
is faster than java.util.BitSet
in most operations
and *much* faster at calculating cardinality of sets and results of set operations.
It can also handle sets of larger cardinality (up to 64 * 2**32-1)
The goals of OpenBitSet
are the fastest implementation possible, and
maximum code reuse. Extra safety and encapsulation
may always be built on top, but if that's built in, the cost can never be removed (and
hence people re-implement their own version in order to get better performance).
If you want a "safe", totally encapsulated (and slower and limited) BitSet
class, use java.util.BitSet
.
cardinality | intersect_count | union | nextSetBit | get | iterator | |
---|---|---|---|---|---|---|
50% full | 3.36 | 3.96 | 1.44 | 1.46 | 1.99 | 1.58 |
1% full | 3.31 | 3.90 | 1.04 | 0.99 |
cardinality | intersect_count | union | nextSetBit | get | iterator | |
---|---|---|---|---|---|---|
50% full | 2.50 | 3.50 | 1.00 | 1.03 | 1.12 | 1.25 |
1% full | 2.51 | 3.49 | 1.00 | 1.02 |
Field Summary |
---|
Fields inherited from class org.apache.lucene.util.OpenBitSet |
---|
bits, wlen |
Fields inherited from class org.apache.lucene.search.DocIdSet |
---|
EMPTY_DOCIDSET |
Constructor Summary | |
---|---|
OpenBitSet()
Deprecated. |
|
OpenBitSet(long numBits)
Deprecated. Constructs an OpenBitSet large enough to hold numBits. |
|
OpenBitSet(long[] bits,
int numWords)
Deprecated. Constructs an OpenBitSet from an existing long[]. |
Method Summary |
---|
Methods inherited from class org.apache.lucene.util.OpenBitSet |
---|
and, andNot, andNotCount, bits2words, capacity, cardinality, clear, clear, clear, clone, ensureCapacity, ensureCapacityWords, equals, expandingWordNum, fastClear, fastClear, fastFlip, fastFlip, fastGet, fastGet, fastSet, fastSet, flip, flip, flipAndGet, flipAndGet, get, get, getAndSet, getAndSet, getBit, getBits, getNumWords, hashCode, intersect, intersectionCount, intersects, isCacheable, isEmpty, iterator, nextSetBit, nextSetBit, or, remove, set, set, setBits, setNumWords, size, trimTrailingZeros, union, unionCount, xor, xorCount |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OpenBitSet(long numBits)
numBits
- public OpenBitSet()
public OpenBitSet(long[] bits, int numWords)
numWords are the number of elements in the array that contain set bits (non-zero longs). numWords should be <= bits.length, and any existing words in the array at position >= numWords should be zero.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |