KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright (C) <2005> <Steve Woodcock> * * 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 smaller 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  *
20  *@author Steve Woodcock
21  */

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

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

100     public MatchNSSmallerQuery(Object JavaDoc nameSpace, Comparable JavaDoc value,boolean inclusive){
101         super(nameSpace,null,value,inclusive,null);
102     }
103     public MatchNSSmallerQuery(Object JavaDoc nameSpace, Comparable JavaDoc value,boolean inclusive,Object JavaDoc alias){
104         super(nameSpace,null,value,inclusive,alias);
105     }
106 }
107
Popular Tags