EmptySearchResult.java
2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.jcr.Node
* javax.jcr.RepositoryException
* org.apache.commons.collections.iterators.EmptyIterator
* org.apache.sling.api.resource.Resource
*/
package com.day.cq.search.impl.result;
import com.day.cq.search.facets.Facet;
import com.day.cq.search.impl.result.SearchResultImpl;
import com.day.cq.search.result.Hit;
import com.day.cq.search.result.ResultPage;
import com.day.cq.search.result.SearchResult;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.commons.collections.iterators.EmptyIterator;
import org.apache.sling.api.resource.Resource;
public class EmptySearchResult
implements SearchResult {
private long executionTime;
public EmptySearchResult(long executionTime) {
this.executionTime = executionTime;
}
@Override
public long getTotalMatches() {
return 0;
}
@Override
public boolean hasMore() {
return false;
}
@Override
public long getStartIndex() {
return 0;
}
@Override
public long getHitsPerPage() {
return 0;
}
@Override
public List<Hit> getHits() {
return new ArrayList<Hit>();
}
@Override
public Iterator<Node> getNodes() {
return EmptyIterator.INSTANCE;
}
@Override
public Iterator<Resource> getResources() {
return EmptyIterator.INSTANCE;
}
@Override
public List<ResultPage> getResultPages() {
return new ArrayList<ResultPage>();
}
@Override
public ResultPage getPreviousPage() {
return null;
}
@Override
public ResultPage getNextPage() {
return null;
}
@Override
public String getExecutionTime() {
return SearchResultImpl.formatExecutionTime(this.executionTime);
}
@Override
public long getExecutionTimeMillis() {
return this.executionTime;
}
@Override
public Map<String, Facet> getFacets() throws RepositoryException {
return new HashMap<String, Facet>();
}
@Override
public String getQueryStatement() {
return "";
}
@Override
public String getFilteringPredicates() {
return "";
}
}