1   /*
2    *  QueryResult.java
3    *
4    *  Copyright (c) 1998-2001, The University of Sheffield.
5    *
6    *  This file is part of GATE (see http://gate.ac.uk/), and is free
7    *  software, licenced under the GNU Library General Public License,
8    *  Version 2, June 1991 (in the distribution as file licence.html,
9    *  and also available at http://gate.ac.uk/gate/licence.html).
10   *
11   *  Rosen Marinov, 19/Apr/2002
12   *
13   */
14  
15  package gate.creole.ir;
16  
17  import java.util.*;
18  import gate.Document;
19  
20  public class QueryResult{
21  
22    /** Persistance document ID.*/
23    private Object docID;
24  
25    /** Score(relevance) of the result between 0 and 1 */
26    private float relevance;
27  
28    /** List of Terms*/
29    private List fieldValues;
30  
31    /** Constructor of the class. */
32    public QueryResult(Object docID,float relevance, List fieldValues){
33      this.docID = docID;
34      this.relevance = relevance;
35      this.fieldValues = fieldValues;
36    }
37  
38    /** @return persistance document ID.*/
39    public Object getDocumentID(){
40      return docID;
41    }
42  
43    /** @return relevance of this result. */
44    public float getScore(){
45      return relevance;
46    }
47  
48    /** returns certain document fields (if specified) from the search() call */
49    public List getFields(){
50      return fieldValues;
51    }
52  
53  }