QueryResult.java |
1 /* 2 * QueryResult.java 3 * 4 * Copyright (c) 1998-2005, 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.List; 18 19 public class QueryResult{ 20 21 /** Persistance document ID.*/ 22 private Object docID; 23 24 /** Score(relevance) of the result between 0 and 1 */ 25 private float relevance; 26 27 /** List of Terms*/ 28 private List fieldValues; 29 30 /** Constructor of the class. */ 31 public QueryResult(Object docID,float relevance, List fieldValues){ 32 this.docID = docID; 33 this.relevance = relevance; 34 this.fieldValues = fieldValues; 35 } 36 37 /** @return persistance document ID.*/ 38 public Object getDocumentID(){ 39 return docID; 40 } 41 42 /** @return relevance of this result. */ 43 public float getScore(){ 44 return relevance; 45 } 46 47 /** returns certain document fields (if specified) from the search() call */ 48 public List getFields(){ 49 return fieldValues; 50 } 51 52 }