1 package org.apache.lucene.search; 2 3 18 19 import org.apache.lucene.util.PriorityQueue; 20 21 final class HitQueue extends PriorityQueue { 22 HitQueue(int size) { 23 initialize(size); 24 } 25 26 protected final boolean lessThan(Object a, Object b) { 27 ScoreDoc hitA = (ScoreDoc)a; 28 ScoreDoc hitB = (ScoreDoc)b; 29 if (hitA.score == hitB.score) 30 return hitA.doc > hitB.doc; 31 else 32 return hitA.score < hitB.score; 33 } 34 } 35 | Popular Tags |