KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jofti > query > MatchSmallerQuery


1 package com.jofti.query;
2
3
4
5 /**
6  *
7  *
8  * A utility class to enable simple queries to be done easily. The Query matches everything smaller than the
9  * value passed in for that particular field. The optional inclusive flag allows the behaviour to be either <= or just <.
10  * <p>
11  *
12  * This query cannot be combined with any other. iF you want to construct more complex queries use the @link com.jofti.query.Query class.
13 <p>
14  * @author Steve Woodcock
15  */

16 public class MatchSmallerQuery extends MatchRangeQuery {
17
18
19     
20     /**
21      * Construct a query supplying the classname of the object type to be returned, the
22      * field to be queried and the value to be used.
23      * <p>
24      * The field type in the object and the value must be of the same type.
25      * <p>
26      * It is assumed that the search is inclusive.
27      * <p>
28      * An example usage would be:
29      * <p>
30      * new MatchSmallerQuery(org.package.Myclass.class, "myProperty" ,"some value");
31      * <p>
32      * @param className - the class of object to be returned.
33      * @param propertyName - the field name to use
34      * @param value - the value that is used as the search value.
35      */

36     public MatchSmallerQuery(Class JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value){
37         super(className,propertyName,null,value,null);
38     }
39     
40     public MatchSmallerQuery(Class JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value,Object JavaDoc alias){
41         super(className,propertyName,null,value,alias);
42     }
43     
44       /**
45      * Construct a query supplying the classname of the object type to be returned, the
46      * field to be queried and the value to be used.
47      * <p>
48      * The field type in the object and the value must be of the same type.
49      * <p>
50      * It is assumed that the search is inclusive.
51      * <p>
52      * An example usage would be:
53      * <p>
54      * new MatchSmallerQuery("org.package.Myclass", "myProperty" ,"some value");
55      * <p>
56      * @param className - the class of object to be returned.
57      * @param propertyName - the field name to use
58      * @param value - the value that is used as the search value.
59      */

60     public MatchSmallerQuery(String JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value){
61         super(className,propertyName,null,value);
62     }
63     
64     public MatchSmallerQuery(String JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value,Object JavaDoc alias){
65         super(className,propertyName,null,value,alias);
66     }
67      /**
68      * Construct a query supplying the classname of the object type to be returned, the
69      * field to be queried and the value to be used. This method allows inclusivity to be set.
70      * <p>
71      * The field type in the object and the value must be of the same type.
72      * <p>
73      * It is assumed that the search is inclusive.
74      * <p>
75      * An example usage would be:
76      * <p>
77      * new MatchSmallerQuery("org.package.Myclass", "myProperty" ,"some value");
78      * <p>
79      * @param className - the class of object to be returned.
80      * @param propertyName - the field name to use
81      * @param value - the value that is used as the search value.
82      * @param inclusive - whether the search should be inclusive.
83      */

84     public MatchSmallerQuery(Class JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive){
85         super(className,propertyName,null,value, inclusive);
86     }
87     
88     public MatchSmallerQuery(Class JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
89         super(className,propertyName,null,value, inclusive,alias);
90     }
91     
92     public MatchSmallerQuery(String JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive){
93         super(className,propertyName,null,value, inclusive);
94     }
95     
96     public MatchSmallerQuery(String JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
97         super(className,propertyName,null,value, inclusive,alias);
98     }
99     /**
100      * Construct a query supplying the value to be searched against.
101      * This is a convenience method for classes (such as String,Integer etc)
102      * that have no property value as such. Instead the value is the class type.
103      * <p>
104      *
105      * An example usage would be:
106      * <p>
107      * new MatchSmallerQuery("some value",true);
108      * <p>
109      * This is so you do not have to use the methods above in the manner of
110      * <p>
111      * new MatchSmallerQuery("java.lang.String", null ,"some value");
112      *
113 <p>
114      * @param value - the value that is used as the search value.
115      * @param inclusive - indicates if the value is to be inclusive in range.
116      */

117     public MatchSmallerQuery(Comparable JavaDoc value, boolean inclusive){
118         super(null,value, inclusive);
119     }
120     
121     public MatchSmallerQuery(Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
122         super(null,value, inclusive,alias);
123     }
124     
125 }
126
Popular Tags