Lucene++ - a full-featured, c++ search engine
API Documentation
Stores and iterate on sorted integers in compressed form in RAM. More...
#include <SortedVIntList.h>
Inheritance diagram for Lucene::SortedVIntList:Public Member Functions | |
| SortedVIntList (Collection< int32_t > sortedInts) | |
| Create a SortedVIntList from all elements of an array of integers. More... | |
| SortedVIntList (Collection< int32_t > sortedInts, int32_t inputSize) | |
| Create a SortedVIntList from an array of integers. More... | |
| SortedVIntList (const BitSetPtr &bits) | |
| Create a SortedVIntList from a BitSet. More... | |
| SortedVIntList (const OpenBitSetPtr &bits) | |
| Create a SortedVIntList from an OpenBitSet. More... | |
| SortedVIntList (const DocIdSetIteratorPtr &docIdSetIterator) | |
| Create a SortedVIntList. More... | |
| virtual | ~SortedVIntList () |
| virtual String | getClassName () |
| boost::shared_ptr< SortedVIntList > | shared_from_this () |
| int32_t | size () |
| int32_t | getByteSize () |
| virtual bool | isCacheable () |
| This DocIdSet implementation is cacheable. More... | |
| virtual DocIdSetIteratorPtr | iterator () |
Public Member Functions inherited from Lucene::DocIdSet | |
| virtual | ~DocIdSet () |
| virtual String | getClassName () |
| boost::shared_ptr< DocIdSet > | shared_from_this () |
| virtual DocIdSetIteratorPtr | iterator ()=0 |
Provides a DocIdSetIterator to access the set. This implementation can return null or EmptyDocIdSet.iterator() if there are no docs that match. More... | |
| virtual bool | isCacheable () |
This method is a hint for CachingWrapperFilter, if this DocIdSet should be cached without copying it into a BitSet. The default is to return false. If you have an own DocIdSet implementation that does its iteration very effective and fast without doing disk I/O, override this method and return true. More... | |
Public Member Functions inherited from Lucene::LuceneObject | |
| virtual | ~LuceneObject () |
| virtual void | initialize () |
| Called directly after instantiation to create objects that depend on this object being fully constructed. More... | |
| virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
| Return clone of this object. More... | |
| virtual int32_t | hashCode () |
| Return hash code for this object. More... | |
| virtual bool | equals (const LuceneObjectPtr &other) |
| Return whether two objects are equal. More... | |
| virtual int32_t | compareTo (const LuceneObjectPtr &other) |
| Compare two objects. More... | |
| virtual String | toString () |
| Returns a string representation of the object. More... | |
Public Member Functions inherited from Lucene::LuceneSync | |
| virtual | ~LuceneSync () |
| virtual SynchronizePtr | getSync () |
| Return this object synchronize lock. More... | |
| virtual LuceneSignalPtr | getSignal () |
| Return this object signal. More... | |
| virtual void | lock (int32_t timeout=0) |
| Lock this object using an optional timeout. More... | |
| virtual void | unlock () |
| Unlock this object. More... | |
| virtual bool | holdsLock () |
| Returns true if this object is currently locked by current thread. More... | |
| virtual void | wait (int32_t timeout=0) |
| Wait for signal using an optional timeout. More... | |
| virtual void | notifyAll () |
| Notify all threads waiting for signal. More... | |
Static Public Member Functions | |
| static String | _getClassName () |
Static Public Member Functions inherited from Lucene::DocIdSet | |
| static String | _getClassName () |
| static DocIdSetPtr | EMPTY_DOCIDSET () |
| An empty {. More... | |
Static Public Attributes | |
| static const int32_t | BITS2VINTLIST_SIZE |
| When a BitSet has fewer than 1 in BITS2VINTLIST_SIZE bits set, a SortedVIntList representing the index numbers of the set bits will be smaller than that BitSet. More... | |
Protected Member Functions | |
| void | initBytes () |
| void | addInt (int32_t nextInt) |
Protected Member Functions inherited from Lucene::LuceneObject | |
| LuceneObject () | |
Protected Attributes | |
| int32_t | _size |
| ByteArray | bytes |
| int32_t | lastBytePos |
| int32_t | lastInt |
Protected Attributes inherited from Lucene::LuceneSync | |
| SynchronizePtr | objectLock |
| LuceneSignalPtr | objectSignal |
Static Protected Attributes | |
| static const int32_t | VB1 |
| static const int32_t | BIT_SHIFT |
| static const int32_t | MAX_BYTES_PER_INT |
Stores and iterate on sorted integers in compressed form in RAM.
The code for compressing the differences between ascending integers was borrowed from IndexInput and IndexOutput.
NOTE: this class assumes the stored integers are doc Ids (hence why it extends DocIdSet). Therefore its iterator() assumes DocIdSetIterator#NO_MORE_DOCS can be used as sentinel. If you intend to use this value, then make sure it's not used during search flow.
| Lucene::SortedVIntList::SortedVIntList | ( | Collection< int32_t > | sortedInts | ) |
Create a SortedVIntList from all elements of an array of integers.
| sortedInts | A sorted array of non negative integers. |
| Lucene::SortedVIntList::SortedVIntList | ( | Collection< int32_t > | sortedInts, |
| int32_t | inputSize | ||
| ) |
Create a SortedVIntList from an array of integers.
| sortedInts | A sorted array of non negative integers. |
| inputSize | The number of integers to be used from the array. |
| Lucene::SortedVIntList::SortedVIntList | ( | const BitSetPtr & | bits | ) |
Create a SortedVIntList from a BitSet.
| bits | A bit set representing a set of integers. |
| Lucene::SortedVIntList::SortedVIntList | ( | const OpenBitSetPtr & | bits | ) |
Create a SortedVIntList from an OpenBitSet.
| bits | A bit set representing a set of integers. |
| Lucene::SortedVIntList::SortedVIntList | ( | const DocIdSetIteratorPtr & | docIdSetIterator | ) |
Create a SortedVIntList.
| docIdSetIterator | An iterator providing document numbers as a set of integers. This DocIdSetIterator is iterated completely when this constructor is called and it must provide the integers in non decreasing order. |
|
virtual |
|
inlinestatic |
|
protected |
| int32_t Lucene::SortedVIntList::getByteSize | ( | ) |
|
inlinevirtual |
Reimplemented from Lucene::DocIdSet.
|
protected |
|
virtual |
This DocIdSet implementation is cacheable.
Reimplemented from Lucene::DocIdSet.
|
virtual |
Implements Lucene::DocIdSet.
|
inline |
| int32_t Lucene::SortedVIntList::size | ( | ) |
|
protected |
|
staticprotected |
|
static |
When a BitSet has fewer than 1 in BITS2VINTLIST_SIZE bits set, a SortedVIntList representing the index numbers of the set bits will be smaller than that BitSet.
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |