1 | /*
|
---|
2 | * TODO.java
|
---|
3 | * Copyright (C) 2000 Stuart Yeates
|
---|
4 | *
|
---|
5 | * This program is free software; you can redistribute it and/or modify
|
---|
6 | * it under the terms of the GNU General Public License as published by
|
---|
7 | * the Free Software Foundation; either version 2 of the License, or
|
---|
8 | * (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this program; if not, write to the Free Software
|
---|
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
18 | */
|
---|
19 |
|
---|
20 | // the package we're in
|
---|
21 | package org.nzdl.gsdl.hli;
|
---|
22 |
|
---|
23 | import org.nzdl.gsdl.service.*;
|
---|
24 | import org.nzdl.gsdl.corba.gsdlInterface.*;
|
---|
25 | import org.nzdl.gsdl.util.*;
|
---|
26 |
|
---|
27 | // java standard library classes used
|
---|
28 | import java.io.IOException;
|
---|
29 | import java.io.Serializable;
|
---|
30 | import java.lang.Cloneable;
|
---|
31 | import java.util.Vector;
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * A high-level view of a Query
|
---|
35 | *
|
---|
36 | * @author stuart yeates ([email protected])
|
---|
37 | * @version $Revision: 2220 $
|
---|
38 | * @see
|
---|
39 | * @see
|
---|
40 | * @see
|
---|
41 | *
|
---|
42 | */
|
---|
43 |
|
---|
44 | public class Query implements Cloneable, Serializable
|
---|
45 | {
|
---|
46 | /** */
|
---|
47 | Collection collection = null;
|
---|
48 |
|
---|
49 | /** */
|
---|
50 | String queryString = "";
|
---|
51 |
|
---|
52 | /** */
|
---|
53 | Vector docIDs = new Vector();
|
---|
54 |
|
---|
55 | /** */
|
---|
56 | Vector documents = new Vector();
|
---|
57 |
|
---|
58 | /** */
|
---|
59 | long numberOfHits = 0;
|
---|
60 |
|
---|
61 | /** */
|
---|
62 | String[] queryTerms = null;
|
---|
63 |
|
---|
64 | /** */
|
---|
65 | long[] termTermFequencies = null;
|
---|
66 |
|
---|
67 | Query(Collection collection, String queryString) {
|
---|
68 | this.collection = collection;
|
---|
69 | this.queryString = queryString;
|
---|
70 | }
|
---|
71 |
|
---|
72 | void runQuery() {
|
---|
73 | if (collection == null)
|
---|
74 | throw new Error ("null collection in runQuery");
|
---|
75 | if (queryString == null)
|
---|
76 | throw new Error ("null queryString in runQuery");
|
---|
77 |
|
---|
78 | // // create the argument objects
|
---|
79 | // corbaFilterResponseHolder reposnse =
|
---|
80 | // NzdlCorbaFactory.createFilterResponseHolder();
|
---|
81 | // corbaFilterRequest request =
|
---|
82 | // NzdlCorbaFactory.createQueryFilterRequest( queryString );
|
---|
83 | // corbatext_t c_name =
|
---|
84 | // NzdlCorbaFactory.toCorbaText( collection.getName() );
|
---|
85 | // corbaComErrorHolder c_err =
|
---|
86 | // NzdlCorbaFactory.createComErrorHolder();
|
---|
87 |
|
---|
88 | // // run the actual query
|
---|
89 | // m_nzdlServer.filter( c_name, request, response, c_err );
|
---|
90 | // if (c_err.value.value() != 0)
|
---|
91 | // System.err.println("service() error " + c_err.value.value());
|
---|
92 |
|
---|
93 | // // parse the results
|
---|
94 | // numberOfHits = response.numDocs;
|
---|
95 |
|
---|
96 |
|
---|
97 | }
|
---|
98 |
|
---|
99 |
|
---|
100 |
|
---|
101 |
|
---|
102 |
|
---|
103 |
|
---|
104 | /**
|
---|
105 | *
|
---|
106 | *
|
---|
107 | * @exception java.io.IOException when ...
|
---|
108 | * @param arg2 ...
|
---|
109 | * @param arg1 ...
|
---|
110 | * @return ...
|
---|
111 | * @see
|
---|
112 | * @see
|
---|
113 | */
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 |
|
---|
118 | /**
|
---|
119 | * Tests...
|
---|
120 | *
|
---|
121 | *
|
---|
122 | * @exception java.io.IOException when ...
|
---|
123 | * @param args the arguments ...
|
---|
124 | */
|
---|
125 |
|
---|
126 | public static void main(String args[]) throws IOException
|
---|
127 | {
|
---|
128 |
|
---|
129 | }
|
---|
130 | }
|
---|
131 |
|
---|