KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > query > FacetConf


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.repository.query;
17
18 public class FacetConf {
19     private boolean isFacet;
20     private int maxValues;
21     private boolean sortOnValue;
22     private boolean sortAscending;
23
24     public FacetConf(boolean isFacet) {
25         this();
26         this.isFacet = isFacet;
27     }
28
29     public FacetConf(int maxValues, boolean sortOnValue, boolean sortAscending) {
30         this.isFacet = true;
31         this.maxValues = maxValues;
32         this.sortOnValue = sortOnValue;
33         this.sortAscending = sortAscending;
34     }
35
36     public FacetConf() {
37         this.isFacet = true;
38         this.maxValues = 10;
39         this.sortOnValue = true;
40         this.sortAscending = true;
41     }
42
43     public boolean isFacet() {
44         return isFacet;
45     }
46
47     public void setIsFacet(boolean isFacet) {
48         this.isFacet = isFacet;
49     }
50
51     /**
52      * The maximum number of distinct values to be returned, -1 for all.
53      */

54     public int getMaxValues() {
55         return maxValues;
56     }
57
58     public void setMaxValues(int maxValues) {
59         this.maxValues = maxValues;
60     }
61
62     /**
63      * If true, the distinct values for this facet should be sorted on value,
64      * otherwise on count.
65      */

66     public boolean getSortOnValue() {
67         return sortOnValue;
68     }
69
70     public void setSortOnValue(boolean sortOnValue) {
71         this.sortOnValue = sortOnValue;
72     }
73
74     /**
75      * If true, sorting happens ascending, otherwise descending.
76      */

77     public boolean getSortAscending() {
78         return sortAscending;
79     }
80
81     public void setSortAscending(boolean sortAscending) {
82         this.sortAscending = sortAscending;
83     }
84 }
85
Popular Tags