LUCENE-2839: Scorer#score(Collector,int,int) is now public because it is called from other classes and part of public API

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1057010 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2011-01-09 19:48:14 +00:00
parent 821e52604c
commit a04ade4448
9 changed files with 11 additions and 10 deletions

View File

@ -131,6 +131,9 @@ Changes in backwards compatibility policy
* LUCENE-2837: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
operate on a ReaderContext instead of directly on IndexReader to enable
searches to be aware of IndexSearcher's context. (Simon Willnauer)
* LUCENE-2839: Scorer#score(Collector,int,int) is now public because it is
called from other classes and part of public API. (Uwe Schindler)
Changes in Runtime Behavior

View File

@ -229,7 +229,7 @@ final class BooleanScorer extends Scorer {
// firstDocID is ignored since nextDoc() initializes 'current'
@Override
protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
public boolean score(Collector collector, int max, int firstDocID) throws IOException {
boolean more;
Bucket tmp;
BucketScorer bs = new BucketScorer();

View File

@ -280,7 +280,7 @@ class BooleanScorer2 extends Scorer {
}
@Override
protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
public boolean score(Collector collector, int max, int firstDocID) throws IOException {
doc = firstDocID;
collector.setScorer(this);
while (doc < max) {

View File

@ -244,10 +244,8 @@ public class ConstantScoreQuery extends Query {
}
// this optimization allows out of order scoring as top scorer,
// TODO: theoretically this method should not be called because its protected and
// this class does not use it, it should be public in Scorer!
@Override
protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
public boolean score(Collector collector, int max, int firstDocID) throws IOException {
if (docIdSetIterator instanceof Scorer) {
return ((Scorer) docIdSetIterator).score(wrapCollector(collector), max, firstDocID);
} else {

View File

@ -123,7 +123,7 @@ class DisjunctionSumScorer extends Scorer {
* @return true if more matching documents may remain.
*/
@Override
protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
public boolean score(Collector collector, int max, int firstDocID) throws IOException {
// firstDocID is ignored since nextDoc() sets 'currentDoc'
collector.setScorer(this);
while (currentDoc < max) {

View File

@ -43,7 +43,7 @@ public class ScoreCachingWrappingScorer extends Scorer {
}
@Override
protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
public boolean score(Collector collector, int max, int firstDocID) throws IOException {
return scorer.score(collector, max, firstDocID);
}

View File

@ -90,7 +90,7 @@ public abstract class Scorer extends DocIdSetIterator {
* this method.
* @return true if more matching documents may remain.
*/
protected boolean score(Collector collector, int max, int firstDocID) throws IOException {
public boolean score(Collector collector, int max, int firstDocID) throws IOException {
collector.setScorer(this);
int doc = firstDocID;
while (doc < max) {

View File

@ -77,7 +77,7 @@ final class TermScorer extends Scorer {
// firstDocID is ignored since nextDoc() sets 'doc'
@Override
protected boolean score(Collector c, int end, int firstDocID) throws IOException {
public boolean score(Collector c, int end, int firstDocID) throws IOException {
c.setScorer(this);
while (doc < end) { // for docs in window
c.collect(doc); // collect score

View File

@ -215,7 +215,7 @@ final class JustCompileSearch {
}
@Override
protected boolean score(Collector collector, int max, int firstDocID)
public boolean score(Collector collector, int max, int firstDocID)
throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}