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

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

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>`

Inheritance diagram for Lucene::ScorerDocQueue:

## 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.
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()).
ScorerPtr | top ()
| Returns the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.
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.
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.
void | adjustTop ()
| Should be called when the scorer at top changes doc() value.
int32_t | size ()
| Returns the number of scorers currently stored in the ScorerDocQueue.
void | clear ()
| Removes all entries from the ScorerDocQueue.
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 ()

## 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.
void | upHeap ()
void | downHeap ()
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Protected Attributes

Collection< HeapedScorerDocPtr > | heap
int32_t | maxSize
int32_t | _size
HeapedScorerDocPtr | topHSD
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Detailed Description

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().

## Constructor & Destructor Documentation

## ◆ ScorerDocQueue()

Lucene::ScorerDocQueue::ScorerDocQueue | ( | int32_t | maxSize | ) |

## ◆ ~ScorerDocQueue()

virtual Lucene::ScorerDocQueue::~ScorerDocQueue | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

static String Lucene::ScorerDocQueue::_getClassName | ( |  | ) |

inline static

## ◆ adjustTop()

void Lucene::ScorerDocQueue::adjustTop | ( |  | ) |

Should be called when the scorer at top changes doc() value.

## ◆ checkAdjustElsePop()

bool Lucene::ScorerDocQueue::checkAdjustElsePop | ( | bool | cond | ) |

protected

## ◆ clear()

void Lucene::ScorerDocQueue::clear | ( |  | ) |

Removes all entries from the ScorerDocQueue.

## ◆ downHeap()

void Lucene::ScorerDocQueue::downHeap | ( |  | ) |

protected

## ◆ getClassName()

virtual String Lucene::ScorerDocQueue::getClassName | ( |  | ) |

inline virtual

## ◆ insert()

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()).

Returns
  true if scorer is added, false otherwise.

## ◆ pop()

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.

## ◆ popNoResult()

void Lucene::ScorerDocQueue::popNoResult | ( |  | ) |

protected

Removes the least scorer of the ScorerDocQueue in log(size) time. Should not be used when the queue is empty.

## ◆ put()

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.

## ◆ shared_from_this()

boost::shared_ptr< ScorerDocQueue > Lucene::ScorerDocQueue::shared_from_this | ( |  | ) |

inline

## ◆ size()

int32_t Lucene::ScorerDocQueue::size | ( |  | ) |

Returns the number of scorers currently stored in the ScorerDocQueue.

## ◆ top()

ScorerPtr Lucene::ScorerDocQueue::top | ( |  | ) |

Returns the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.

## ◆ topDoc()

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.

## ◆ topNextAndAdjustElsePop()

bool Lucene::ScorerDocQueue::topNextAndAdjustElsePop | ( |  | ) |

## ◆ topScore()

double Lucene::ScorerDocQueue::topScore | ( |  | ) |

## ◆ topSkipToAndAdjustElsePop()

bool Lucene::ScorerDocQueue::topSkipToAndAdjustElsePop | ( | int32_t | target | ) |

## ◆ upHeap()

void Lucene::ScorerDocQueue::upHeap | ( |  | ) |

protected

## Field Documentation

## ◆ _size

int32_t Lucene::ScorerDocQueue::_size

protected

## ◆ heap

Collection<HeapedScorerDocPtr> Lucene::ScorerDocQueue::heap

protected

## ◆ maxSize

int32_t Lucene::ScorerDocQueue::maxSize

protected

## ◆ topHSD

HeapedScorerDocPtr Lucene::ScorerDocQueue::topHSD

protected

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

- ScorerDocQueue.h

clucene.sourceforge.net