factor out (public static) MultiCollector.scoreMode(Collector[]) method

This commit is contained in:
Christine Poerschke 2024-02-21 17:37:12 +00:00
parent 568c8eba97
commit ada853e3df
1 changed files with 6 additions and 2 deletions

View File

@ -101,8 +101,7 @@ public class MultiCollector implements Collector {
this.cacheScores = numNeedsScores >= 2; this.cacheScores = numNeedsScores >= 2;
} }
@Override public static ScoreMode scoreMode(Collector[] collectors) {
public ScoreMode scoreMode() {
ScoreMode scoreMode = null; ScoreMode scoreMode = null;
for (Collector collector : collectors) { for (Collector collector : collectors) {
if (scoreMode == null) { if (scoreMode == null) {
@ -120,6 +119,11 @@ public class MultiCollector implements Collector {
return scoreMode; return scoreMode;
} }
@Override
public ScoreMode scoreMode() {
return scoreMode(collectors);
}
@Override @Override
public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
final List<LeafCollector> leafCollectors = new ArrayList<>(collectors.length); final List<LeafCollector> leafCollectors = new ArrayList<>(collectors.length);