java.lang.Object | |
↳ | org.apache.lucene.util.ScorerDocQueue |
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().
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a ScorerDocQueue with a maximum size.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Should be called when the scorer at top changes doc() value.
| |||||||||||
Removes all entries from the ScorerDocQueue.
| |||||||||||
Adds a Scorer to the ScorerDocQueue in log(size) time if either
the ScorerDocQueue is not full, or not lessThan(scorer, top()).
| |||||||||||
Removes and returns the least scorer of the ScorerDocQueue in log(size)
time.
| |||||||||||
Adds a Scorer to a ScorerDocQueue in log(size) time.
| |||||||||||
Returns the number of scorers currently stored in the ScorerDocQueue.
| |||||||||||
Returns the least Scorer of the ScorerDocQueue in constant time.
| |||||||||||
Returns document number of the least Scorer of the ScorerDocQueue
in constant time.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a ScorerDocQueue with a maximum size.
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); }
Removes all entries from the ScorerDocQueue.
Adds a Scorer to the ScorerDocQueue in log(size) time if either the ScorerDocQueue is not full, or not lessThan(scorer, top()).
Removes and returns the least scorer of the ScorerDocQueue in log(size) time. Should not be used when the queue is empty.
Adds a Scorer to a ScorerDocQueue in log(size) time. If one tries to add more Scorers than maxSize a RuntimeException (ArrayIndexOutOfBound) is thrown.
Returns the number of scorers currently stored in the ScorerDocQueue.
Returns the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.
Returns document number of the least Scorer of the ScorerDocQueue in constant time. Should not be used when the queue is empty.