KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

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

85     public MatchLargerQuery(Class JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive){
86         super(className,propertyName,value,null,inclusive,null);
87     }
88     
89     public MatchLargerQuery(Class JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
90         super(className,propertyName,value,null,inclusive,alias);
91     }
92     
93     public MatchLargerQuery(String JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive){
94         super(className,propertyName,value,null,inclusive,null);
95     }
96     public MatchLargerQuery(String JavaDoc className, String JavaDoc propertyName, Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
97         super(className,propertyName,value,null,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 MatchLargerQuery("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 MatchLargerQuery("java.lang.String", null ,"some value");
112      * <p>
113
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 MatchLargerQuery(Comparable JavaDoc value, boolean inclusive){
118         super(value,null ,inclusive,null);
119     }
120     
121     public MatchLargerQuery(Comparable JavaDoc value, boolean inclusive,Object JavaDoc alias){
122         super(value,null ,inclusive,alias);
123     }
124 }
125
Popular Tags