Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AbstractSearch |
|
| 1.0;1 |
1 | package org.jtheque.films.services.impl.utils.search; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque 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 JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.jtheque.primary.od.abstraction.Data; | |
20 | ||
21 | import java.util.ArrayList; | |
22 | import java.util.List; | |
23 | ||
24 | /** | |
25 | * An abstract search for some Data. | |
26 | * | |
27 | * @author Baptiste Wicht | |
28 | * @param <T> The extended type of Data. | |
29 | */ | |
30 | 0 | public abstract class AbstractSearch<T extends Data> implements Search<T> { |
31 | private List<T> results; | |
32 | private T result; | |
33 | private Searcher<T> searcher; | |
34 | ||
35 | @Override | |
36 | public T getResult() { | |
37 | 0 | return result; |
38 | } | |
39 | ||
40 | @Override | |
41 | public final List<T> getResults() { | |
42 | 0 | return results; |
43 | } | |
44 | ||
45 | @Override | |
46 | public final void setResults(List<T> results) { | |
47 | 0 | this.results = new ArrayList<T>(results); |
48 | 0 | } |
49 | ||
50 | @Override | |
51 | public void setResult(T result) { | |
52 | 0 | this.result = result; |
53 | 0 | } |
54 | ||
55 | @Override | |
56 | public final Searcher<T> getSearcher() { | |
57 | 0 | return searcher; |
58 | } | |
59 | ||
60 | @Override | |
61 | public final void setSearcher(Searcher<T> searcher) { | |
62 | 0 | this.searcher = searcher; |
63 | 0 | } |
64 | } |