| 8090 |
leisch |
1 |
/*============================================================================
|
| 1230 |
leisch |
2 |
|
|
|
3 |
Project: Simple JAVA Search Engine for Keyword Search
|
|
|
4 |
|
|
|
5 |
JAVA Source file for the class IndexTable
|
|
|
6 |
|
| 8090 |
leisch |
7 |
COPYRIGHT (C), 1998-2000, Thomas Baier, R Core Development Team
|
| 3765 |
leisch |
8 |
|
|
|
9 |
* This program is free software; you can redistribute it and/or modify
|
|
|
10 |
* it under the terms of the GNU General Public License as published by
|
|
|
11 |
* the Free Software Foundation; either version 2 of the License, or
|
|
|
12 |
* (at your option) any later version.
|
|
|
13 |
*
|
|
|
14 |
* This program is distributed in the hope that it will be useful,
|
|
|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
17 |
* GNU General Public License for more details.
|
|
|
18 |
*
|
|
|
19 |
* You should have received a copy of the GNU General Public License
|
|
|
20 |
* along with this program; if not, write to the Free Software
|
| 5458 |
ripley |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
22 |
|
| 1230 |
leisch |
23 |
|
|
|
24 |
|
| 8090 |
leisch |
25 |
$Revision: 1.5 $
|
| 1230 |
leisch |
26 |
|
| 8090 |
leisch |
27 |
$Date: 2000/02/10 17:03:55 $
|
| 1230 |
leisch |
28 |
|
| 8090 |
leisch |
29 |
$Author: leisch $
|
| 1230 |
leisch |
30 |
|
| 8090 |
leisch |
31 |
============================================================================*/
|
| 1230 |
leisch |
32 |
|
|
|
33 |
|
|
|
34 |
import java.util.Vector;
|
|
|
35 |
import java.util.Enumeration;
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
public class IndexTable extends Vector
|
|
|
39 |
{
|
|
|
40 |
|
| 8090 |
leisch |
41 |
public Vector search (String key, boolean searchDesc,
|
|
|
42 |
boolean searchKeywords, boolean searchAliases)
|
| 1230 |
leisch |
43 |
{
|
|
|
44 |
Vector returnValue = new Vector ();
|
|
|
45 |
Enumeration cursor = elements ();
|
| 8090 |
leisch |
46 |
|
| 1230 |
leisch |
47 |
while (cursor.hasMoreElements ()) {
|
|
|
48 |
IndexEntry entry = (IndexEntry) cursor.nextElement ();
|
|
|
49 |
|
| 8090 |
leisch |
50 |
if (entry.matches (key, searchDesc,
|
|
|
51 |
searchKeywords, searchAliases)){
|
| 1230 |
leisch |
52 |
returnValue.addElement (entry);
|
|
|
53 |
}
|
|
|
54 |
}
|
|
|
55 |
if (!returnValue.isEmpty ()) {
|
|
|
56 |
return returnValue;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
return null;
|
|
|
60 |
}
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
// Local Variables:
|
|
|
65 |
// mode: Java
|
|
|
66 |
// mode: font-lock
|
|
|
67 |
// End:
|