1 /*
2 QueryJ
3
4 Copyright (C) 2002 Jose San Leandro Armend?riz
5 jsanleandro@yahoo.es
6 chousz@yahoo.com
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 Thanks to ACM S.L. for distributing this library under the GPL license.
23 Contact info: jsanleandro@yahoo.es
24 Postal Address: c/Playa de Lagoa, 1
25 Urb. Valdecaba?as
26 Boadilla del monte
27 28660 Madrid
28 Spain
29
30 ******************************************************************************
31 *
32 * Filename: $RCSfile: IntField.java,v $
33 *
34 * Author: Jose San Leandro Armend?riz
35 *
36 * Description: Represents integer fields.
37 *
38 * Last modified by: $Author: chous $ at $Date: 2003/08/29 08:14:59 $
39 *
40 * File version: $Revision: 1.1 $
41 *
42 * Project version: $Name: $
43 *
44 * $Id: IntField.java,v 1.1 2003/08/29 08:14:59 chous Exp $
45 *
46 */
47 package org.acmsl.queryj;
48
49 /*
50 * Importing some ACM-SL classes.
51 */
52 import org.acmsl.queryj.Field;
53
54 /***
55 * Represents integer fields.
56 * @author <a href="mailto:jsanleandro@yahoo.es"
57 >Jose San Leandro</a>
58 * @version $Revision: 1.1 $
59 */
60 public abstract class IntField
61 extends Field
62 {
63 /***
64 * Creates an integer field using given information.
65 * @param name the field name.
66 * @param table the table.
67 */
68 public IntField(String name, Table table)
69 {
70 super(name, table);
71 }
72
73 /***
74 * Retrieves the variable condition to be able to filter for equality.
75 * @param value the value.
76 * @return such kind of condition.
77 */
78 public Condition equals(int value)
79 {
80 Condition result = null;
81
82 ConditionFactory t_ConditionFactory =
83 ConditionFactory.getInstance();
84
85 ConditionOperatorRepository t_ConditionOperatorRepository =
86 ConditionOperatorRepository.getInstance();
87
88 if ( (t_ConditionFactory != null)
89 && (t_ConditionOperatorRepository != null))
90 {
91 result =
92 t_ConditionFactory.createCondition(
93 this,
94 t_ConditionOperatorRepository.getEquals(),
95 value);
96 }
97
98 return result;
99 }
100
101 /***
102 * Retrieves the variable condition to be able to filter for non-equality.
103 * @param value the value.
104 * @return such kind of condition.
105 */
106 public Condition notEquals(int value)
107 {
108 Condition result = null;
109
110 ConditionFactory t_ConditionFactory =
111 ConditionFactory.getInstance();
112
113 ConditionOperatorRepository t_ConditionOperatorRepository =
114 ConditionOperatorRepository.getInstance();
115
116 if ( (t_ConditionFactory != null)
117 && (t_ConditionOperatorRepository != null))
118 {
119 result =
120 t_ConditionFactory.createCondition(
121 this,
122 t_ConditionOperatorRepository.getNotEquals(),
123 value);
124 }
125
126 return result;
127 }
128
129 /***
130 * Retrieves the variable condition to be able to filter for lower values.
131 * @param value the value.
132 * @return such kind of condition.
133 */
134 public Condition greaterThan(int value)
135 {
136 Condition result = null;
137
138 ConditionFactory t_ConditionFactory =
139 ConditionFactory.getInstance();
140
141 ConditionOperatorRepository t_ConditionOperatorRepository =
142 ConditionOperatorRepository.getInstance();
143
144 if ( (t_ConditionFactory != null)
145 && (t_ConditionOperatorRepository != null))
146 {
147 result =
148 t_ConditionFactory.createCondition(
149 this,
150 t_ConditionOperatorRepository.getGreaterThan(),
151 value);
152 }
153
154 return result;
155 }
156
157 /***
158 * Retrieves the variable condition to be able to filter for higher values.
159 * @param value the value.
160 * @return such kind of condition.
161 */
162 public Condition lessThan(int value)
163 {
164 Condition result = null;
165
166 ConditionFactory t_ConditionFactory =
167 ConditionFactory.getInstance();
168
169 ConditionOperatorRepository t_ConditionOperatorRepository =
170 ConditionOperatorRepository.getInstance();
171
172 if ( (t_ConditionFactory != null)
173 && (t_ConditionOperatorRepository != null))
174 {
175 result =
176 t_ConditionFactory.createCondition(
177 this,
178 t_ConditionOperatorRepository.getLessThan(),
179 value);
180 }
181
182 return result;
183 }
184 }
This page was automatically generated by Maven