Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
72 bool get(int32_t index);
79 bool get(int64_t index);
90 void set(int64_t index);
103 void set(int64_t startIndex, int64_t endIndex);
119 void clear(int32_t startIndex, int32_t endIndex);
124 void clear(int64_t startIndex, int64_t endIndex);
156 void flip(int64_t startIndex, int64_t endIndex);
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
bool flipAndGet(int64_t index)
Flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.
void flip(int64_t startIndex, int64_t endIndex)
Flips a range of bits, expanding the set size if necessary.
void intersect(const OpenBitSetPtr &other)
this = this AND other
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
void fastClear(int64_t index)
Clears a bit. The index should be less than the OpenBitSet size.
void _union(const OpenBitSetPtr &other)
this = this OR other
bool fastGet(int32_t index)
Returns true or false for the specified bit index. The index should be less than the OpenBitSet size.
LongArray bits
Definition: OpenBitSet.h:37
void fastSet(int32_t index)
Sets the bit at the specified index. The index should be less than the OpenBitSet size.
int32_t getBit(int32_t index)
Returns 1 if the bit is set, 0 if not. The index should be less than the OpenBitSet size.
void fastFlip(int32_t index)
Flips a bit. The index should be less than the OpenBitSet size.
void setBits(LongArray bits)
Sets a new long[] to use as the bit storage.
void flip(int64_t index)
Flips a bit, expanding the set size if necessary.
void fastClear(int32_t index)
Clears a bit. The index should be less than the OpenBitSet size.
void _or(const OpenBitSetPtr &other)
see union
void trimTrailingZeros()
Lowers numWords, the number of words in use, by checking for trailing zero words.
void fastSet(int64_t index)
Sets the bit at the specified index. The index should be less than the OpenBitSet size.
int32_t wlen
Definition: OpenBitSet.h:41
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Return clone of this object.
void set(int64_t index)
Sets a bit, expanding the set size if necessary.
int32_t expandingWordNum(int64_t index)
virtual int32_t hashCode()
Return hash code for this object.
int32_t getNumWords()
Gets the number of longs in the array that are in use.
A DocIdSet contains a set of doc ids. Implementing classes must only implement iterator to provide ac...
Definition: DocIdSet.h:16
int64_t nextSetBit(int64_t index)
Returns the index of the first set bit starting at the index specified. -1 is returned if there are n...
Definition: AbstractAllTermDocs.h:12
void clear(int64_t startIndex, int64_t endIndex)
Clears a range of bits. Clearing past the end does not change the size of the set.
void clear(int64_t index)
Clears a bit, allowing access beyond the current set size without changing the size.
OpenBitSet(int64_t numBits=64)
Constructs an OpenBitSet large enough to hold numBits.
bool getAndSet(int32_t index)
Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.
bool get(int32_t index)
Returns true or false for the specified bit index.
bool fastGet(int64_t index)
Returns true or false for the specified bit index. The index should be less than the OpenBitSet size.
virtual DocIdSetIteratorPtr iterator()
Provides a DocIdSetIterator to access the set. This implementation can return null or EmptyDocIdSet....
void _xor(const OpenBitSetPtr &other)
this = this XOR other
bool isEmpty()
Returns true if there are no set bits.
void andNot(const OpenBitSetPtr &other)
see remove
boost::shared_ptr< DocIdSetIterator > DocIdSetIteratorPtr
Definition: LuceneTypes.h:324
void clear(int32_t startIndex, int32_t endIndex)
Clears a range of bits. Clearing past the end does not change the size of the set.
boost::shared_ptr< OpenBitSet > OpenBitSetPtr
Definition: LuceneTypes.h:543
virtual bool equals(const LuceneObjectPtr &other)
Returns true if both sets have the same bits set.
bool flipAndGet(int32_t index)
Flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.
LongArray getBits()
Returns the long[] storing the bits.
int64_t capacity()
Returns the current capacity in bits (1 greater than the index of the last bit)
void fastFlip(int64_t index)
Flips a bit. The index should be less than the OpenBitSet size.
An "open" BitSet implementation that allows direct access to the array of words storing the bits.
Definition: OpenBitSet.h:19
int32_t nextSetBit(int32_t index)
Returns the index of the first set bit starting at the index specified. -1 is returned if there are n...
bool get(int64_t index)
Returns true or false for the specified bit index.
virtual bool isCacheable()
This DocIdSet implementation is cacheable.
int64_t size()
Returns the current capacity of this set. Included for compatibility. This is not equal to cardinalit...
void setNumWords(int32_t numWords)
Sets the number of longs in the array that are in use.
void ensureCapacityWords(int32_t numWords)
Expand the LongArray with the size given as a number of words (64 bit longs). getNumWords() is unchan...
bool intersects(const OpenBitSetPtr &other)
Returns true if the sets have any elements in common.
void set(int64_t startIndex, int64_t endIndex)
Sets a range of bits, expanding the set size if necessary.
bool getAndSet(int64_t index)
Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.
void remove(const OpenBitSetPtr &other)
Remove all elements set in other. this = this AND_NOT other.
static int64_t intersectionCount(const OpenBitSetPtr &a, const OpenBitSetPtr &b)
Returns the popcount or cardinality of the intersection of the two sets. Neither set is modified.
void _and(const OpenBitSetPtr &other)
see intersect
static int64_t unionCount(const OpenBitSetPtr &a, const OpenBitSetPtr &b)
Returns the popcount or cardinality of the union of the two sets. Neither set is modified.
OpenBitSet(LongArray bits, int32_t numWords)
Constructs an OpenBitSet from an existing LongArray.
static int32_t bits2words(int64_t numBits)
Returns the number of 64 bit words it would take to hold numBits.
void ensureCapacity(int64_t numBits)
Ensure that the LongArray is big enough to hold numBits, expanding it if necessary....
static int64_t andNotCount(const OpenBitSetPtr &a, const OpenBitSetPtr &b)
Returns the popcount or cardinality of "a and not b" or "intersection(a, not(b))"....
static int64_t xorCount(const OpenBitSetPtr &a, const OpenBitSetPtr &b)
Returns the popcount or cardinality of the exclusive-or of the two sets. Neither set is modified.
clucene.sourceforge.net