Coverage Report - org.galagosearch.core.retrieval.ScoredDocument
 
Classes in this File Line Coverage Branch Coverage Complexity
ScoredDocument
89%
8/9
100%
2/2
0
 
 1  
 // BSD License (http://www.galagosearch.org/license)
 2  
 
 3  
 package org.galagosearch.core.retrieval;
 4  
 
 5  
 /**
 6  
  *
 7  
  * @author trevor
 8  
  */
 9  48
 public class ScoredDocument implements Comparable<ScoredDocument> {
 10  20
     public ScoredDocument(int document, double score) {
 11  20
         this.document = document;
 12  20
         this.score = score;
 13  20
     }
 14  
 
 15  
     public int compareTo(ScoredDocument other) {
 16  48
         if(score != other.score)
 17  44
             return Double.compare(score, other.score);
 18  4
         return other.document - document;
 19  
     }
 20  
     
 21  
     public String toString() {
 22  0
         return String.format("%d,%f", document, score);
 23  
     }
 24  
 
 25  
     public int document;
 26  
     public double score;
 27  
 }
 28