KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jofti > query > namespace > MatchNSLargerQuery


1 /*
2  * Created on Jun 5, 2005
3  *
4  */

5 package com.jofti.query.namespace;
6
7 /**
8  *
9  *
10  * A utility class to enable simple queries to be done easily. The Query matches everything larger than the
11  * value passed in for that particular field. The optional inclusive flag allows the behaviour to be either >= or just >.
12  * <p>
13  * All nameSpace queries must provide a correct namespace type for the implementation. Some nameSPaces
14  * are hierachical and so the search will use the nameSpace as starting point. Others are flat and so there is no
15  * traversal step.
16  * <p>
17  * This query acannot be combined with any other. iF you want to construct more complex queries use the @link com.jofti.query.Query class.
18  * <p>
19  * @author Steve Woodcock
20  */

21 public class MatchNSLargerQuery extends MatchNSRangeQuery {
22     
23     
24     /**
25      * Construct a query supplying the classname of the object type to be returned, the namespace
26      * under which to start the search. The field to be queried and the value to be used.
27      * <p>
28      * The field type in the object and the value must be of the same type.
29      * <p>
30      * It is assumed that the search is inclusive.
31      * <p>
32      * An example usage (for JBossCache) would be:
33      * <p>
34      * new MatchNSLargerQuery("org.package.Myclass", "/test", "myProperty" ,"some value");
35      * <p>
36      * @param className - the class of object to be returned.
37      * @param nameSpace - the name space to be searched.
38      * @param propertyName - the field name to use
39      * @param value - the value that is used as the search value.
40      */

41     public MatchNSLargerQuery(Class JavaDoc className, Object JavaDoc nameSpace,String JavaDoc propertyName, Comparable JavaDoc value){
42         this(className,nameSpace,propertyName,value,null);
43     }
44     public MatchNSLargerQuery(Class JavaDoc className, Object JavaDoc nameSpace,String JavaDoc propertyName, Comparable JavaDoc value,Object JavaDoc alias){
45         super(className,nameSpace,propertyName,value,null,alias);
46     }
47     
48     public MatchNSLargerQuery(String JavaDoc className, Object JavaDoc nameSpace,String JavaDoc propertyName, Comparable JavaDoc value){
49         this(className,nameSpace,propertyName,value,null);
50     }
51     public MatchNSLargerQuery(String JavaDoc className, Object JavaDoc nameSpace,String JavaDoc propertyName, Comparable JavaDoc value,Object JavaDoc alias){
52         super(className,nameSpace,propertyName,value,null,alias);
53     }
54     /**
55      * Construct a query supplying the classname of the object type to be returned, the namespace
56      * under which to start the search. The field to be queried and the value to be used. The method
57      * also allows control of whether the query is inclusive of the value or not.
58      * <p>
59      * The field type in the object and the value must be of the same type.
60      * <p>
61      * An example usage (for JBossCache) would be:
62      * <p>
63      * new MatchNSLargerQuery("org.package.Myclass", "/test", "myProperty" ,"some value");
64      * <p>
65      * @param className - the class of object to be returned.
66      * @param nameSpace - the name space to be searched.
67      * @param propertyName - the field name to use
68      * @param value - the value that is used as the search value.
69      * @param inclusive - indicates if the value is to be inclusive in range.
70      */

71     public MatchNSLargerQuery(Class JavaDoc className, Object JavaDoc nameSpace, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive){
72         this(className,nameSpace,propertyName,value, inclusive,null);
73     }
74     public MatchNSLargerQuery(Class JavaDoc className, Object JavaDoc nameSpace, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
75         super(className,nameSpace,propertyName,value,null,inclusive,alias);
76     }
77     
78     public MatchNSLargerQuery(String JavaDoc className, Object JavaDoc nameSpace, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive){
79         this(className,nameSpace,propertyName,value,inclusive,null);
80     }
81     public MatchNSLargerQuery(String JavaDoc className, Object JavaDoc nameSpace, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
82         super(className,nameSpace,propertyName,value,null,inclusive,alias);
83     }
84     
85     /**
86      * Construct a query supplying the value to be searched against and the namespace
87      * under which to start the search. This is a convenience method for classes (such as String,Integer etc)
88      * that have no property value as such. Instead the value is the class type.
89      * <p>
90      *
91      * An example usage (for JBossCache) would be:
92      * <p>
93      * new MatchNSLargerQuery( "/test","some value",true);
94      * <p>
95      * This is so you do not have to use the methods above in the manner of
96      * <p>
97      * new MatchNSLargerQuery("java.lang.String", "/test", null ,"some value");
98      * <p>
99
100      * @param nameSpace - the name space to be searched.
101      * @param value - the value that is used as the search value.
102      * @param inclusive - indicates if the value is to be inclusive in range.
103      */

104     public MatchNSLargerQuery(Object JavaDoc nameSpace, Comparable JavaDoc value,boolean inclusive){
105         super(nameSpace,value,null,inclusive,null);
106     }
107     
108     public MatchNSLargerQuery(Object JavaDoc nameSpace, Comparable JavaDoc value,boolean inclusive,Object JavaDoc alias){
109         super(nameSpace,value,null,inclusive,alias);
110     }
111     
112 }
113
Popular Tags