ir.vsr
Class Retrieval

java.lang.Object
  extended by ir.vsr.Retrieval
All Implemented Interfaces:
java.lang.Comparable

public class Retrieval
extends java.lang.Object
implements java.lang.Comparable

A lightweight object for storing information about a retrieved Document.


Field Summary
 DocumentReference docRef
          A reference to the Document being retrieved
 double score
          The score given to this document by a retrieval engine.
 
Constructor Summary
Retrieval(DocumentReference docRef, double score)
          Create a retrieval with these values
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares this Retrieval to another for sorting from best to worst.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

docRef

public DocumentReference docRef
A reference to the Document being retrieved


score

public double score
The score given to this document by a retrieval engine. Higher scores mean it is more relevant to the query

Constructor Detail

Retrieval

public Retrieval(DocumentReference docRef,
                 double score)
Create a retrieval with these values

Method Detail

compareTo

public int compareTo(java.lang.Object obj)
Compares this Retrieval to another for sorting from best to worst.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - The Retrieval to compare with.
Returns:
-1 if better than obj, 0 if same, 1 if worse than obj since this will produce a descending sort from best to worst.
See Also:
Arrays.sort(long[])