Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
SearchResults |
|
| 0.0;0 |
1 | package org.apache.archiva.indexer.search; | |
2 | ||
3 | /* | |
4 | * Licensed to the Apache Software Foundation (ASF) under one | |
5 | * or more contributor license agreements. See the NOTICE file | |
6 | * distributed with this work for additional information | |
7 | * regarding copyright ownership. The ASF licenses this file | |
8 | * to you under the Apache License, Version 2.0 (the | |
9 | * "License"); you may not use this file except in compliance | |
10 | * with the License. You may obtain a copy of the License at | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
14 | * Unless required by applicable law or agreed to in writing, | |
15 | * software distributed under the License is distributed on an | |
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
17 | * KIND, either express or implied. See the License for the | |
18 | * specific language governing permissions and limitations | |
19 | * under the License. | |
20 | */ | |
21 | ||
22 | import java.util.ArrayList; | |
23 | import java.util.HashMap; | |
24 | import java.util.List; | |
25 | import java.util.Map; | |
26 | ||
27 | ||
28 | /** | |
29 | * SearchResults | |
30 | * | |
31 | * @version $Id: SearchResults.java 742859 2009-02-10 05:35:05Z jdumay $ | |
32 | */ | |
33 | public class SearchResults | |
34 | { | |
35 | 0 | private Map<String, SearchResultHit> hits = new HashMap<String, SearchResultHit>(); |
36 | ||
37 | private int totalHits; | |
38 | ||
39 | private SearchResultLimits limits; | |
40 | ||
41 | public SearchResults() | |
42 | 0 | { |
43 | /* do nothing */ | |
44 | 0 | } |
45 | ||
46 | // for new RepositorySearch | |
47 | public void addHit( String id, SearchResultHit hit ) | |
48 | { | |
49 | 0 | hits.put( id, hit ); |
50 | 0 | } |
51 | ||
52 | /** | |
53 | * Get the list of {@link SearchResultHit} objects. | |
54 | * | |
55 | * @return the list of {@link SearchResultHit} objects. | |
56 | */ | |
57 | public List<SearchResultHit> getHits() | |
58 | { | |
59 | 0 | return new ArrayList<SearchResultHit>( hits.values() ); |
60 | } | |
61 | ||
62 | public Map<String, SearchResultHit> getHitsMap() | |
63 | { | |
64 | 0 | return hits; |
65 | } | |
66 | ||
67 | public boolean isEmpty() | |
68 | { | |
69 | 0 | return hits.isEmpty(); |
70 | } | |
71 | ||
72 | public SearchResultLimits getLimits() | |
73 | { | |
74 | 0 | return limits; |
75 | } | |
76 | ||
77 | public void setLimits( SearchResultLimits limits ) | |
78 | { | |
79 | 0 | this.limits = limits; |
80 | 0 | } |
81 | ||
82 | public int getTotalHits() | |
83 | { | |
84 | 0 | return totalHits; |
85 | } | |
86 | ||
87 | public void setTotalHits( int totalHits ) | |
88 | { | |
89 | 0 | this.totalHits = totalHits; |
90 | 0 | } |
91 | } |