Lucene++ - a full-featured, c++ search engine
API Documentation


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
Lucene::SortedVIntList Class Reference

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.
 
 SortedVIntList (Collection< int32_t > sortedInts, int32_t inputSize)
 Create a SortedVIntList from an array of integers.
 
 SortedVIntList (const BitSetPtr &bits)
 Create a SortedVIntList from a BitSet.
 
 SortedVIntList (const OpenBitSetPtr &bits)
 Create a SortedVIntList from an OpenBitSet.
 
 SortedVIntList (const DocIdSetIteratorPtr &docIdSetIterator)
 Create a SortedVIntList.
 
virtual ~SortedVIntList ()
 
virtual String getClassName ()
 
boost::shared_ptr< SortedVIntListshared_from_this ()
 
int32_t size ()
 
int32_t getByteSize ()
 
virtual bool isCacheable ()
 This DocIdSet implementation is cacheable.
 
virtual DocIdSetIteratorPtr iterator ()
 
- Public Member Functions inherited from Lucene::DocIdSet
virtual ~DocIdSet ()
 
boost::shared_ptr< DocIdSetshared_from_this ()
 
- 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.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
virtual String toString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

Static Public Member Functions

static String _getClassName ()
 
- Static Public Member Functions inherited from Lucene::DocIdSet
static String _getClassName ()
 
static DocIdSetPtr EMPTY_DOCIDSET ()
 An empty {.
 

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.
 

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SortedVIntList() [1/5]

Lucene::SortedVIntList::SortedVIntList ( Collection< int32_t >  sortedInts)

Create a SortedVIntList from all elements of an array of integers.

Parameters
sortedIntsA sorted array of non negative integers.

◆ SortedVIntList() [2/5]

Lucene::SortedVIntList::SortedVIntList ( Collection< int32_t >  sortedInts,
int32_t  inputSize 
)

Create a SortedVIntList from an array of integers.

Parameters
sortedIntsA sorted array of non negative integers.
inputSizeThe number of integers to be used from the array.

◆ SortedVIntList() [3/5]

Lucene::SortedVIntList::SortedVIntList ( const BitSetPtr bits)

Create a SortedVIntList from a BitSet.

Parameters
bitsA bit set representing a set of integers.

◆ SortedVIntList() [4/5]

Lucene::SortedVIntList::SortedVIntList ( const OpenBitSetPtr bits)

Create a SortedVIntList from an OpenBitSet.

Parameters
bitsA bit set representing a set of integers.

◆ SortedVIntList() [5/5]

Lucene::SortedVIntList::SortedVIntList ( const DocIdSetIteratorPtr docIdSetIterator)

Create a SortedVIntList.

Parameters
docIdSetIteratorAn 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.

◆ ~SortedVIntList()

virtual Lucene::SortedVIntList::~SortedVIntList ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::SortedVIntList::_getClassName ( )
inlinestatic

◆ addInt()

void Lucene::SortedVIntList::addInt ( int32_t  nextInt)
protected

◆ getByteSize()

int32_t Lucene::SortedVIntList::getByteSize ( )
Returns
The size of the byte array storing the compressed sorted integers.

◆ getClassName()

virtual String Lucene::SortedVIntList::getClassName ( )
inlinevirtual

Reimplemented from Lucene::DocIdSet.

◆ initBytes()

void Lucene::SortedVIntList::initBytes ( )
protected

◆ isCacheable()

virtual bool Lucene::SortedVIntList::isCacheable ( )
virtual

This DocIdSet implementation is cacheable.

Reimplemented from Lucene::DocIdSet.

◆ iterator()

virtual DocIdSetIteratorPtr Lucene::SortedVIntList::iterator ( )
virtual
Returns
An iterator over the sorted integers.

Implements Lucene::DocIdSet.

◆ shared_from_this()

boost::shared_ptr< SortedVIntList > Lucene::SortedVIntList::shared_from_this ( )
inline

◆ size()

int32_t Lucene::SortedVIntList::size ( )
Returns
The total number of sorted integers.

Field Documentation

◆ _size

int32_t Lucene::SortedVIntList::_size
protected

◆ BIT_SHIFT

const int32_t Lucene::SortedVIntList::BIT_SHIFT
staticprotected

◆ BITS2VINTLIST_SIZE

const int32_t Lucene::SortedVIntList::BITS2VINTLIST_SIZE
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.

◆ bytes

ByteArray Lucene::SortedVIntList::bytes
protected

◆ lastBytePos

int32_t Lucene::SortedVIntList::lastBytePos
protected

◆ lastInt

int32_t Lucene::SortedVIntList::lastInt
protected

◆ MAX_BYTES_PER_INT

const int32_t Lucene::SortedVIntList::MAX_BYTES_PER_INT
staticprotected

◆ VB1

const int32_t Lucene::SortedVIntList::VB1
staticprotected

The documentation for this class was generated from the following file:

clucene.sourceforge.net