1   /*
2    *  QueryResultList.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.Iterator;
18  import java.util.List;
19  
20  public class QueryResultList{
21  
22    /** Executed query. */
23    private String queryString;
24  
25    /** Corpus in which query was execute. */
26    private IndexedCorpus corpus;
27  
28    /** List of QueryResult objects. */
29    private List results;
30  
31    /* Niraj */
32    /* Default Constructor */
33    // do not delete this as it is must to subclass this class
34    public QueryResultList() {
35    }
36    /* End */
37  
38    /** Constructor of the class. */
39    public QueryResultList(String query, IndexedCorpus corpus, List results){
40      this.queryString = query;
41      this.corpus = corpus;
42      this.results = results;
43    }
44  
45    /** @return String executed query */
46    public String getQueryString(){
47      return queryString;
48    }
49  
50    /** @return IndexedCorpus corpus where this query was execute. */
51    public IndexedCorpus getQueryCorpus(){
52      return corpus;
53    }
54  
55    /** @return Iterator of QueryResult objects.
56     *  @see gate.creole.ir.QueryResult */
57    public Iterator getQueryResults(){
58      return results.iterator();
59    }
60  }