1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.zilverline.core;
23
24 /***
25 * The SearchResult represent the result of a Search. It contains the number of hits and the results, as well as the starting and
26 * ending number of the result. So possibly an Array of 20 results, from 234 hits, results 21 to 40.
27 *
28 * @author Michael Franken
29 * @version $Revision: 1.4 $
30 *
31 * @see org.zilverline.core.FileSystemCollection
32 */
33 public final class SearchResult {
34
35 /***
36 * Create a SearchResult with the number of hits and the results, as well as the starting and ending number of the result. So
37 * possibly an Array of 20 results, from 234 hits, results 21 to 40.
38 *
39 * @param thisResults the array of Results
40 * @param thisNumberOfHits the total number of Hits, probably larger than the results
41 * @param thisStartAt the first results 'offset' into all hits
42 * @param thisEndAt the last results 'offset' into all hits
43 */
44 public SearchResult(final Result[] thisResults, final int thisNumberOfHits, final int thisStartAt, final int thisEndAt) {
45 results = thisResults;
46 numberOfHits = thisNumberOfHits;
47 startAt = thisStartAt;
48 endAt = thisEndAt;
49 }
50
51 /*** The results. */
52 private Result[] results;
53
54 /*** The number of results. */
55 private int numberOfHits;
56
57 /*** The first results 'offset' into all hits. */
58 private int endAt;
59
60 /*** The last results 'offset' into all hits. */
61 private int startAt;
62
63 /***
64 * Returns the the total number of Hits. Probably larger than the size if results
65 *
66 * @return numberOfHits
67 */
68 public int getNumberOfHits() {
69 return numberOfHits;
70 }
71
72 /***
73 * Returns the results as an Array.
74 *
75 * @return results
76 */
77 public Result[] getResults() {
78 return results;
79 }
80
81 /***
82 * Returns offset into all Hits of the last Result.
83 *
84 * @return Returns the endAt.
85 */
86 public int getEndAt() {
87 return endAt;
88 }
89
90 /***
91 * Returns offset into all Hits of the first Result.
92 *
93 * @return Returns the startAt.
94 */
95 public int getStartAt() {
96 return startAt;
97 }
98 }