01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.outerj.daisy.query;
17:
18: import org.outerj.daisy.ftindex.Hits;
19: import org.outerj.daisy.repository.query.EvaluationContext;
20: import org.outerj.daisy.repository.query.QueryException;
21:
22: public class EvaluationInfo {
23: private EvaluationContext evaluationContext;
24: private QueryContext queryContext;
25: private Hits hits;
26: private Boolean searchLastVersion;
27:
28: public EvaluationInfo(QueryContext queryContext) {
29: this .queryContext = queryContext;
30: this .evaluationContext = new EvaluationContext();
31: }
32:
33: public EvaluationInfo(QueryContext queryContext,
34: EvaluationContext evaluationContext) {
35: this .queryContext = queryContext;
36: this .evaluationContext = evaluationContext;
37: }
38:
39: public EvaluationContext getEvaluationContext() {
40: return evaluationContext;
41: }
42:
43: public void setEvaluationContext(EvaluationContext evaluationContext) {
44: this .evaluationContext = evaluationContext;
45: }
46:
47: public Hits getHits() {
48: return hits;
49: }
50:
51: public void setHits(Hits hits) {
52: this .hits = hits;
53: }
54:
55: public boolean getSearchLastVersion() {
56: if (searchLastVersion == null)
57: throw new RuntimeException(
58: "Tried to access searchLastVersion flag, but it is not set.");
59: return searchLastVersion;
60: }
61:
62: public void setSearchLastVersion(boolean searchLastVersion) {
63: this .searchLastVersion = searchLastVersion;
64: }
65:
66: public QueryContext getQueryContext() {
67: return queryContext;
68: }
69:
70: public void dispose() throws QueryException {
71: if (this.hits != null)
72: this.hits.dispose();
73: }
74: }
|