Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Classes | Public Member Functions | List of all members
Lucene.Net.Util.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...

Public Member Functions

 ScorerDocQueue (int maxSize)
 Create a ScorerDocQueue with a maximum size.
 
void Put (Scorer scorer)
 Adds a Scorer to a ScorerDocQueue in log(size) time. If one tries to add more Scorers than maxSize a RuntimeException (ArrayIndexOutOfBound) is thrown.
 
virtual bool Insert (Scorer scorer)
 Adds a Scorer to the ScorerDocQueue in log(size) time if either the ScorerDocQueue is not full, or not lessThan(scorer, top()).
 
Scorer Top ()
 Returns the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.
 
int TopDoc ()
 Returns document number of the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.
 
float TopScore ()
 
bool TopNextAndAdjustElsePop ()
 
bool TopSkipToAndAdjustElsePop (int target)
 
Scorer 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. Still log(n) worst case, but it's at least twice as fast to { pq.top().change(); pq.adjustTop(); } instead of { o = pq.pop(); o.change(); pq.push(o); }
 
int Size ()
 Returns the number of scorers currently stored in the ScorerDocQueue.
 
void Clear ()
 Removes all entries from the ScorerDocQueue.
 

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

Definition at line 32 of file ScorerDocQueue.cs.

Constructor & Destructor Documentation

Lucene.Net.Util.ScorerDocQueue.ScorerDocQueue ( int  maxSize)

Create a ScorerDocQueue with a maximum size.

Definition at line 77 of file ScorerDocQueue.cs.

Member Function Documentation

void Lucene.Net.Util.ScorerDocQueue.AdjustTop ( )

Should be called when the scorer at top changes doc() value. Still log(n) worst case, but it's at least twice as fast to { pq.top().change(); pq.adjustTop(); } instead of { o = pq.pop(); o.change(); pq.push(o); }

Definition at line 212 of file ScorerDocQueue.cs.

void Lucene.Net.Util.ScorerDocQueue.Clear ( )

Removes all entries from the ScorerDocQueue.

Definition at line 226 of file ScorerDocQueue.cs.

virtual bool Lucene.Net.Util.ScorerDocQueue.Insert ( Scorer  scorer)
virtual

Adds a Scorer to the ScorerDocQueue in log(size) time if either the ScorerDocQueue is not full, or not lessThan(scorer, top()).

Parameters
scorer
Returns
true if scorer is added, false otherwise.

Definition at line 105 of file ScorerDocQueue.cs.

Scorer Lucene.Net.Util.ScorerDocQueue.Pop ( )

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

Definition at line 186 of file ScorerDocQueue.cs.

void Lucene.Net.Util.ScorerDocQueue.Put ( Scorer  scorer)

Adds a Scorer to a ScorerDocQueue in log(size) time. If one tries to add more Scorers than maxSize a RuntimeException (ArrayIndexOutOfBound) is thrown.

Definition at line 91 of file ScorerDocQueue.cs.

int Lucene.Net.Util.ScorerDocQueue.Size ( )

Returns the number of scorers currently stored in the ScorerDocQueue.

Definition at line 220 of file ScorerDocQueue.cs.

Scorer Lucene.Net.Util.ScorerDocQueue.Top ( )

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

Definition at line 132 of file ScorerDocQueue.cs.

int Lucene.Net.Util.ScorerDocQueue.TopDoc ( )

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

Definition at line 142 of file ScorerDocQueue.cs.

bool Lucene.Net.Util.ScorerDocQueue.TopNextAndAdjustElsePop ( )

Definition at line 154 of file ScorerDocQueue.cs.

float Lucene.Net.Util.ScorerDocQueue.TopScore ( )

Definition at line 148 of file ScorerDocQueue.cs.

bool Lucene.Net.Util.ScorerDocQueue.TopSkipToAndAdjustElsePop ( int  target)

Definition at line 159 of file ScorerDocQueue.cs.


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