KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > CompareHint


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/CompareHint.java,v 1.8 2004/07/28 09:35:12 ib Exp $
3  * $Revision: 1.8 $
4  * $Date: 2004/07/28 09:35:12 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.search;
25
26 /**
27  * Gives some hints to a comparator, that compares resources. You can specify,
28  * if compare is case sensitive, ascending or descending, and the resource's
29  * property, on which the compare shall take place.
30  *
31  * @version $Revision: 1.8 $
32  */

33 import org.apache.slide.common.PropertyName;
34 //import org.apache.slide.search.basic.ComparedProperty;
35

36 public class CompareHint {
37
38     /** the name of the property, which shall be compared */
39     protected String JavaDoc propName;
40
41     /** the property's namespace */
42     protected String JavaDoc propNamespace;
43
44     /** if the associated comparator is used for sort, ascending or descending? */
45     private boolean ascending;
46
47     /** is compare case sensitive or not */
48     private boolean caseSensitive;
49
50     private PropertyName comparedProperty;
51
52
53     /**
54      * Method getPropName
55      *
56      * @return the property's name
57      *
58      */

59     public String JavaDoc getPropName () {
60         return propName;
61     }
62
63     /**
64      * Method getPropNamespace
65      *
66      * @return the property's namespace
67      *
68      */

69     public String JavaDoc getPropNamespace () {
70         return propNamespace;
71     }
72
73     /**
74      * Method isAscending
75      *
76      * @return a boolean
77      *
78      */

79     public boolean isAscending () {
80         return ascending;
81     }
82
83     /**
84      * Method isCaseSensitive
85      *
86      * @return a boolean
87      *
88      */

89     public boolean isCaseSensitive () {
90         return caseSensitive;
91     }
92
93
94     /**
95      * Constructor
96      *
97      * @param prop a ComparedProperty
98      * @param ascending a boolean
99      * @param caseSensitive a boolean
100      *
101      */

102     public CompareHint (PropertyName prop, boolean ascending, boolean caseSensitive) {
103         this.propName = prop.getName();
104         this.propNamespace = prop.getNamespace();
105         this.ascending = ascending;
106         this.caseSensitive = caseSensitive;
107         this.comparedProperty = prop;
108     }
109
110
111     /**
112      * Method getComparedProperty
113      *
114      * @return a ComparedProperty
115      *
116      */

117     public PropertyName getComparedProperty () {
118         return comparedProperty;
119     }
120 }
121
122
Popular Tags