Lucene++ - a full-featured, c++ search engine
API Documentation
A ScorerDocQueue maintains a partial ordering of its Scorers such that the least Scorer can always be found in constant time. Put()'s and pop()'s require log(size) time. The ordering is by Scorer::doc(). More...
#include <ScorerDocQueue.h>
Public Member Functions | |
ScorerDocQueue (int32_t maxSize) | |
virtual | ~ScorerDocQueue () |
virtual String | getClassName () |
boost::shared_ptr< ScorerDocQueue > | shared_from_this () |
void | put (const ScorerPtr &scorer) |
Adds a Scorer to a ScorerDocQueue in log(size) time. If one tries to add more Scorers than maxSize ArrayIndexOutOfBound exception is thrown. More... | |
bool | insert (const ScorerPtr &scorer) |
Adds a Scorer to the ScorerDocQueue in log(size) time if either the ScorerDocQueue is not full, or not lessThan(scorer, top()). More... | |
ScorerPtr | top () |
Returns the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty. More... | |
int32_t | topDoc () |
Returns document number of the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty. More... | |
double | topScore () |
bool | topNextAndAdjustElsePop () |
bool | topSkipToAndAdjustElsePop (int32_t target) |
ScorerPtr | pop () |
Removes and returns the least scorer of the ScorerDocQueue in log(size) time. Should not be used when the queue is empty. More... | |
void | adjustTop () |
Should be called when the scorer at top changes doc() value. More... | |
int32_t | size () |
Returns the number of scorers currently stored in the ScorerDocQueue. More... | |
void | clear () |
Removes all entries from the ScorerDocQueue. More... | |
![]() | |
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... | |
![]() | |
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 () |
Protected Member Functions | |
bool | checkAdjustElsePop (bool cond) |
void | popNoResult () |
Removes the least scorer of the ScorerDocQueue in log(size) time. Should not be used when the queue is empty. More... | |
void | upHeap () |
void | downHeap () |
![]() | |
LuceneObject () | |
Protected Attributes | |
Collection< HeapedScorerDocPtr > | heap |
int32_t | maxSize |
int32_t | _size |
HeapedScorerDocPtr | topHSD |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
A ScorerDocQueue maintains a partial ordering of its Scorers such that the least Scorer can always be found in constant time. Put()'s and pop()'s require log(size) time. The ordering is by Scorer::doc().
Lucene::ScorerDocQueue::ScorerDocQueue | ( | int32_t | maxSize | ) |
|
virtual |
|
inlinestatic |
void Lucene::ScorerDocQueue::adjustTop | ( | ) |
Should be called when the scorer at top changes doc() value.
|
protected |
void Lucene::ScorerDocQueue::clear | ( | ) |
Removes all entries from the ScorerDocQueue.
|
protected |
|
inlinevirtual |
bool Lucene::ScorerDocQueue::insert | ( | const ScorerPtr & | scorer | ) |
Adds a Scorer to the ScorerDocQueue in log(size) time if either the ScorerDocQueue is not full, or not lessThan(scorer, top()).
ScorerPtr Lucene::ScorerDocQueue::pop | ( | ) |
Removes and returns the least scorer of the ScorerDocQueue in log(size) time. Should not be used when the queue is empty.
|
protected |
Removes the least scorer of the ScorerDocQueue in log(size) time. Should not be used when the queue is empty.
void Lucene::ScorerDocQueue::put | ( | const ScorerPtr & | scorer | ) |
Adds a Scorer to a ScorerDocQueue in log(size) time. If one tries to add more Scorers than maxSize ArrayIndexOutOfBound exception is thrown.
|
inline |
int32_t Lucene::ScorerDocQueue::size | ( | ) |
Returns the number of scorers currently stored in the ScorerDocQueue.
ScorerPtr Lucene::ScorerDocQueue::top | ( | ) |
Returns the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.
int32_t Lucene::ScorerDocQueue::topDoc | ( | ) |
Returns document number of the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.
bool Lucene::ScorerDocQueue::topNextAndAdjustElsePop | ( | ) |
double Lucene::ScorerDocQueue::topScore | ( | ) |
bool Lucene::ScorerDocQueue::topSkipToAndAdjustElsePop | ( | int32_t | target | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |