|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.ScorerDocQueue
public class 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().
Constructor Summary | |
---|---|
ScorerDocQueue(int maxSize)
Create a ScorerDocQueue with a maximum size. |
Method Summary | |
---|---|
void |
adjustTop()
Should be called when the scorer at top changes doc() value. |
void |
clear()
Removes all entries from the ScorerDocQueue. |
boolean |
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 |
pop()
Removes and returns the least scorer of the ScorerDocQueue in log(size) time. |
void |
put(Scorer scorer)
Adds a Scorer to a ScorerDocQueue in log(size) time. |
int |
size()
Returns the number of scorers currently stored in the ScorerDocQueue. |
Scorer |
top()
Returns the least Scorer of the ScorerDocQueue in constant time. |
int |
topDoc()
Returns document number of the least Scorer of the ScorerDocQueue in constant time. |
boolean |
topNextAndAdjustElsePop()
|
float |
topScore()
|
boolean |
topSkipToAndAdjustElsePop(int target)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScorerDocQueue(int maxSize)
Method Detail |
---|
public final void put(Scorer scorer)
public boolean insert(Scorer scorer)
scorer
-
public final Scorer top()
public final int topDoc()
public final float topScore() throws IOException
IOException
public final boolean topNextAndAdjustElsePop() throws IOException
IOException
public final boolean topSkipToAndAdjustElsePop(int target) throws IOException
IOException
public final Scorer pop()
public final void adjustTop()
{ pq.top().change(); pq.adjustTop(); }instead of
{ o = pq.pop(); o.change(); pq.push(o); }
public final int size()
public final void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |