1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services.search;
18
19 import java.util.ArrayList;
20 import java.util.List;
21
22
23 /***
24 * Container for search result entries
25 *
26 * @author <a href="mailto:taylor@apache.org">David Sean taylor</a>
27 * @version $Id: SearchResults.java,v 1.3 2004/02/23 03:48:47 jford Exp $
28 */
29 public class SearchResults
30 {
31 private List results = null;
32
33 /***
34 */
35 public SearchResults()
36 {
37 init(0);
38 }
39
40 /***
41 *
42 * @param initialCapacity
43 */
44 public SearchResults(int initialCapacity)
45 {
46 init(initialCapacity);
47 }
48
49 /***
50 *
51 * @param initialCapacity
52 */
53 private void init(int initialCapacity)
54 {
55 results = new ArrayList(initialCapacity);
56 }
57
58 /***
59 *
60 * @param searchResult
61 * @return
62 */
63 public boolean add(ParsedObject searchResult)
64 {
65 return results.add(searchResult);
66 }
67
68 /***
69 *
70 * @param index
71 * @param searchResult
72 */
73 public void add(int index, ParsedObject searchResult)
74 {
75 results.add(index, searchResult);
76 return;
77 }
78
79 /***
80 *
81 * @param index
82 * @return
83 */
84 public ParsedObject get(int index)
85 {
86 return(ParsedObject) results.get(index);
87 }
88
89 /***
90 *
91 * @return
92 */
93 public int size()
94 {
95 return results.size();
96 }
97
98 /***
99 *
100 * @return
101 */
102 public List getResults()
103 {
104 return this.results;
105 }
106 }