KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > editor > Doml > JdbcType


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id$
6  */

7 package org.enhydra.dods.editor.Doml;
8
9 import java.util.Arrays JavaDoc;
10 import java.util.Collections JavaDoc;
11 import java.util.List JavaDoc;
12
13 import org.eclipse.emf.common.util.AbstractEnumerator;
14
15 /**
16  * <!-- begin-user-doc -->
17  * A representation of the literals of the enumeration '<em><b>Jdbc Type</b></em>',
18  * and utility methods for working with them.
19  * <!-- end-user-doc -->
20  * @see org.enhydra.dods.editor.Doml.DomlPackage#getJdbcType()
21  * @model
22  * @generated
23  */

24 public final class JdbcType extends AbstractEnumerator {
25     /**
26      * The '<em><b>BIT</b></em>' literal value.
27      * <!-- begin-user-doc -->
28      * <!-- end-user-doc -->
29      * @see #BIT_LITERAL
30      * @model
31      * @generated
32      * @ordered
33      */

34     public static final int BIT = 0;
35
36     /**
37      * The '<em><b>TINYINT</b></em>' literal value.
38      * <!-- begin-user-doc -->
39      * <!-- end-user-doc -->
40      * @see #TINYINT_LITERAL
41      * @model
42      * @generated
43      * @ordered
44      */

45     public static final int TINYINT = 1;
46
47     /**
48      * The '<em><b>SMALLINT</b></em>' literal value.
49      * <!-- begin-user-doc -->
50      * <!-- end-user-doc -->
51      * @see #SMALLINT_LITERAL
52      * @model
53      * @generated
54      * @ordered
55      */

56     public static final int SMALLINT = 2;
57
58     /**
59      * The '<em><b>INTEGER</b></em>' literal value.
60      * <!-- begin-user-doc -->
61      * <!-- end-user-doc -->
62      * @see #INTEGER_LITERAL
63      * @model
64      * @generated
65      * @ordered
66      */

67     public static final int INTEGER = 3;
68
69     /**
70      * The '<em><b>BIGINT</b></em>' literal value.
71      * <!-- begin-user-doc -->
72      * <!-- end-user-doc -->
73      * @see #BIGINT_LITERAL
74      * @model
75      * @generated
76      * @ordered
77      */

78     public static final int BIGINT = 4;
79
80     /**
81      * The '<em><b>REAL</b></em>' literal value.
82      * <!-- begin-user-doc -->
83      * <!-- end-user-doc -->
84      * @see #REAL_LITERAL
85      * @model
86      * @generated
87      * @ordered
88      */

89     public static final int REAL = 5;
90
91     /**
92      * The '<em><b>FLOAT</b></em>' literal value.
93      * <!-- begin-user-doc -->
94      * <!-- end-user-doc -->
95      * @see #FLOAT_LITERAL
96      * @model
97      * @generated
98      * @ordered
99      */

100     public static final int FLOAT = 6;
101
102     /**
103      * The '<em><b>DOUBLE</b></em>' literal value.
104      * <!-- begin-user-doc -->
105      * <!-- end-user-doc -->
106      * @see #DOUBLE_LITERAL
107      * @model
108      * @generated
109      * @ordered
110      */

111     public static final int DOUBLE = 7;
112
113     /**
114      * The '<em><b>NUMERIC</b></em>' literal value.
115      * <!-- begin-user-doc -->
116      * <!-- end-user-doc -->
117      * @see #NUMERIC_LITERAL
118      * @model
119      * @generated
120      * @ordered
121      */

122     public static final int NUMERIC = 8;
123
124     /**
125      * The '<em><b>DECIMAL</b></em>' literal value.
126      * <!-- begin-user-doc -->
127      * <!-- end-user-doc -->
128      * @see #DECIMAL_LITERAL
129      * @model
130      * @generated
131      * @ordered
132      */

133     public static final int DECIMAL = 9;
134
135     /**
136      * The '<em><b>CHAR</b></em>' literal value.
137      * <!-- begin-user-doc -->
138      * <!-- end-user-doc -->
139      * @see #CHAR_LITERAL
140      * @model
141      * @generated
142      * @ordered
143      */

144     public static final int CHAR = 10;
145
146     /**
147      * The '<em><b>VARCHAR</b></em>' literal value.
148      * <!-- begin-user-doc -->
149      * <!-- end-user-doc -->
150      * @see #VARCHAR_LITERAL
151      * @model
152      * @generated
153      * @ordered
154      */

155     public static final int VARCHAR = 11;
156
157     /**
158      * The '<em><b>LONGVARCHAR</b></em>' literal value.
159      * <!-- begin-user-doc -->
160      * <!-- end-user-doc -->
161      * @see #LONGVARCHAR_LITERAL
162      * @model
163      * @generated
164      * @ordered
165      */

166     public static final int LONGVARCHAR = 12;
167
168     /**
169      * The '<em><b>BINARY</b></em>' literal value.
170      * <!-- begin-user-doc -->
171      * <!-- end-user-doc -->
172      * @see #BINARY_LITERAL
173      * @model
174      * @generated
175      * @ordered
176      */

177     public static final int BINARY = 13;
178
179     /**
180      * The '<em><b>VARBINARY</b></em>' literal value.
181      * <!-- begin-user-doc -->
182      * <!-- end-user-doc -->
183      * @see #VARBINARY_LITERAL
184      * @model
185      * @generated
186      * @ordered
187      */

188     public static final int VARBINARY = 14;
189
190     /**
191      * The '<em><b>LONGVARBINARY</b></em>' literal value.
192      * <!-- begin-user-doc -->
193      * <!-- end-user-doc -->
194      * @see #LONGVARBINARY_LITERAL
195      * @model
196      * @generated
197      * @ordered
198      */

199     public static final int LONGVARBINARY = 15;
200
201     /**
202      * The '<em><b>DATE</b></em>' literal value.
203      * <!-- begin-user-doc -->
204      * <!-- end-user-doc -->
205      * @see #DATE_LITERAL
206      * @model
207      * @generated
208      * @ordered
209      */

210     public static final int DATE = 16;
211
212     /**
213      * The '<em><b>TIME</b></em>' literal value.
214      * <!-- begin-user-doc -->
215      * <!-- end-user-doc -->
216      * @see #TIME_LITERAL
217      * @model
218      * @generated
219      * @ordered
220      */

221     public static final int TIME = 17;
222
223     /**
224      * The '<em><b>TIMESTAMP</b></em>' literal value.
225      * <!-- begin-user-doc -->
226      * <!-- end-user-doc -->
227      * @see #TIMESTAMP_LITERAL
228      * @model
229      * @generated
230      * @ordered
231      */

232     public static final int TIMESTAMP = 18;
233
234     /**
235      * The '<em><b>BIT</b></em>' literal object.
236      * <!-- begin-user-doc -->
237      * <p>
238      * If the meaning of '<em><b>BIT</b></em>' literal object isn't clear,
239      * there really should be more of a description here...
240      * </p>
241      * <!-- end-user-doc -->
242      * @see #BIT
243      * @generated
244      * @ordered
245      */

246     public static final JdbcType BIT_LITERAL = new JdbcType(BIT, "BIT");
247
248     /**
249      * The '<em><b>TINYINT</b></em>' literal object.
250      * <!-- begin-user-doc -->
251      * <p>
252      * If the meaning of '<em><b>TINYINT</b></em>' literal object isn't clear,
253      * there really should be more of a description here...
254      * </p>
255      * <!-- end-user-doc -->
256      * @see #TINYINT
257      * @generated
258      * @ordered
259      */

260     public static final JdbcType TINYINT_LITERAL = new JdbcType(TINYINT, "TINYINT");
261
262     /**
263      * The '<em><b>SMALLINT</b></em>' literal object.
264      * <!-- begin-user-doc -->
265      * <p>
266      * If the meaning of '<em><b>SMALLINT</b></em>' literal object isn't clear,
267      * there really should be more of a description here...
268      * </p>
269      * <!-- end-user-doc -->
270      * @see #SMALLINT
271      * @generated
272      * @ordered
273      */

274     public static final JdbcType SMALLINT_LITERAL = new JdbcType(SMALLINT, "SMALLINT");
275
276     /**
277      * The '<em><b>INTEGER</b></em>' literal object.
278      * <!-- begin-user-doc -->
279      * <p>
280      * If the meaning of '<em><b>INTEGER</b></em>' literal object isn't clear,
281      * there really should be more of a description here...
282      * </p>
283      * <!-- end-user-doc -->
284      * @see #INTEGER
285      * @generated
286      * @ordered
287      */

288     public static final JdbcType INTEGER_LITERAL = new JdbcType(INTEGER, "INTEGER");
289
290     /**
291      * The '<em><b>BIGINT</b></em>' literal object.
292      * <!-- begin-user-doc -->
293      * <p>
294      * If the meaning of '<em><b>BIGINT</b></em>' literal object isn't clear,
295      * there really should be more of a description here...
296      * </p>
297      * <!-- end-user-doc -->
298      * @see #BIGINT
299      * @generated
300      * @ordered
301      */

302     public static final JdbcType BIGINT_LITERAL = new JdbcType(BIGINT, "BIGINT");
303
304     /**
305      * The '<em><b>REAL</b></em>' literal object.
306      * <!-- begin-user-doc -->
307      * <p>
308      * If the meaning of '<em><b>REAL</b></em>' literal object isn't clear,
309      * there really should be more of a description here...
310      * </p>
311      * <!-- end-user-doc -->
312      * @see #REAL
313      * @generated
314      * @ordered
315      */

316     public static final JdbcType REAL_LITERAL = new JdbcType(REAL, "REAL");
317
318     /**
319      * The '<em><b>FLOAT</b></em>' literal object.
320      * <!-- begin-user-doc -->
321      * <p>
322      * If the meaning of '<em><b>FLOAT</b></em>' literal object isn't clear,
323      * there really should be more of a description here...
324      * </p>
325      * <!-- end-user-doc -->
326      * @see #FLOAT
327      * @generated
328      * @ordered
329      */

330     public static final JdbcType FLOAT_LITERAL = new JdbcType(FLOAT, "FLOAT");
331
332     /**
333      * The '<em><b>DOUBLE</b></em>' literal object.
334      * <!-- begin-user-doc -->
335      * <p>
336      * If the meaning of '<em><b>DOUBLE</b></em>' literal object isn't clear,
337      * there really should be more of a description here...
338      * </p>
339      * <!-- end-user-doc -->
340      * @see #DOUBLE
341      * @generated
342      * @ordered
343      */

344     public static final JdbcType DOUBLE_LITERAL = new JdbcType(DOUBLE, "DOUBLE");
345
346     /**
347      * The '<em><b>NUMERIC</b></em>' literal object.
348      * <!-- begin-user-doc -->
349      * <p>
350      * If the meaning of '<em><b>NUMERIC</b></em>' literal object isn't clear,
351      * there really should be more of a description here...
352      * </p>
353      * <!-- end-user-doc -->
354      * @see #NUMERIC
355      * @generated
356      * @ordered
357      */

358     public static final JdbcType NUMERIC_LITERAL = new JdbcType(NUMERIC, "NUMERIC");
359
360     /**
361      * The '<em><b>DECIMAL</b></em>' literal object.
362      * <!-- begin-user-doc -->
363      * <p>
364      * If the meaning of '<em><b>DECIMAL</b></em>' literal object isn't clear,
365      * there really should be more of a description here...
366      * </p>
367      * <!-- end-user-doc -->
368      * @see #DECIMAL
369      * @generated
370      * @ordered
371      */

372     public static final JdbcType DECIMAL_LITERAL = new JdbcType(DECIMAL, "DECIMAL");
373
374     /**
375      * The '<em><b>CHAR</b></em>' literal object.
376      * <!-- begin-user-doc -->
377      * <p>
378      * If the meaning of '<em><b>CHAR</b></em>' literal object isn't clear,
379      * there really should be more of a description here...
380      * </p>
381      * <!-- end-user-doc -->
382      * @see #CHAR
383      * @generated
384      * @ordered
385      */

386     public static final JdbcType CHAR_LITERAL = new JdbcType(CHAR, "CHAR");
387
388     /**
389      * The '<em><b>VARCHAR</b></em>' literal object.
390      * <!-- begin-user-doc -->
391      * <p>
392      * If the meaning of '<em><b>VARCHAR</b></em>' literal object isn't clear,
393      * there really should be more of a description here...
394      * </p>
395      * <!-- end-user-doc -->
396      * @see #VARCHAR
397      * @generated
398      * @ordered
399      */

400     public static final JdbcType VARCHAR_LITERAL = new JdbcType(VARCHAR, "VARCHAR");
401
402     /**
403      * The '<em><b>LONGVARCHAR</b></em>' literal object.
404      * <!-- begin-user-doc -->
405      * <p>
406      * If the meaning of '<em><b>LONGVARCHAR</b></em>' literal object isn't clear,
407      * there really should be more of a description here...
408      * </p>
409      * <!-- end-user-doc -->
410      * @see #LONGVARCHAR
411      * @generated
412      * @ordered
413      */

414     public static final JdbcType LONGVARCHAR_LITERAL = new JdbcType(LONGVARCHAR, "LONGVARCHAR");
415
416     /**
417      * The '<em><b>BINARY</b></em>' literal object.
418      * <!-- begin-user-doc -->
419      * <p>
420      * If the meaning of '<em><b>BINARY</b></em>' literal object isn't clear,
421      * there really should be more of a description here...
422      * </p>
423      * <!-- end-user-doc -->
424      * @see #BINARY
425      * @generated
426      * @ordered
427      */

428     public static final JdbcType BINARY_LITERAL = new JdbcType(BINARY, "BINARY");
429
430     /**
431      * The '<em><b>VARBINARY</b></em>' literal object.
432      * <!-- begin-user-doc -->
433      * <p>
434      * If the meaning of '<em><b>VARBINARY</b></em>' literal object isn't clear,
435      * there really should be more of a description here...
436      * </p>
437      * <!-- end-user-doc -->
438      * @see #VARBINARY
439      * @generated
440      * @ordered
441      */

442     public static final JdbcType VARBINARY_LITERAL = new JdbcType(VARBINARY, "VARBINARY");
443
444     /**
445      * The '<em><b>LONGVARBINARY</b></em>' literal object.
446      * <!-- begin-user-doc -->
447      * <p>
448      * If the meaning of '<em><b>LONGVARBINARY</b></em>' literal object isn't clear,
449      * there really should be more of a description here...
450      * </p>
451      * <!-- end-user-doc -->
452      * @see #LONGVARBINARY
453      * @generated
454      * @ordered
455      */

456     public static final JdbcType LONGVARBINARY_LITERAL = new JdbcType(LONGVARBINARY, "LONGVARBINARY");
457
458     /**
459      * The '<em><b>DATE</b></em>' literal object.
460      * <!-- begin-user-doc -->
461      * <p>
462      * If the meaning of '<em><b>DATE</b></em>' literal object isn't clear,
463      * there really should be more of a description here...
464      * </p>
465      * <!-- end-user-doc -->
466      * @see #DATE
467      * @generated
468      * @ordered
469      */

470     public static final JdbcType DATE_LITERAL = new JdbcType(DATE, "DATE");
471
472     /**
473      * The '<em><b>TIME</b></em>' literal object.
474      * <!-- begin-user-doc -->
475      * <p>
476      * If the meaning of '<em><b>TIME</b></em>' literal object isn't clear,
477      * there really should be more of a description here...
478      * </p>
479      * <!-- end-user-doc -->
480      * @see #TIME
481      * @generated
482      * @ordered
483      */

484     public static final JdbcType TIME_LITERAL = new JdbcType(TIME, "TIME");
485
486     /**
487      * The '<em><b>TIMESTAMP</b></em>' literal object.
488      * <!-- begin-user-doc -->
489      * <p>
490      * If the meaning of '<em><b>TIMESTAMP</b></em>' literal object isn't clear,
491      * there really should be more of a description here...
492      * </p>
493      * <!-- end-user-doc -->
494      * @see #TIMESTAMP
495      * @generated
496      * @ordered
497      */

498     public static final JdbcType TIMESTAMP_LITERAL = new JdbcType(TIMESTAMP, "TIMESTAMP");
499
500     /**
501      * An array of all the '<em><b>Jdbc Type</b></em>' enumerators.
502      * <!-- begin-user-doc -->
503      * <!-- end-user-doc -->
504      * @generated
505      */

506     private static final JdbcType[] VALUES_ARRAY =
507         new JdbcType[] {
508             BIT_LITERAL,
509             TINYINT_LITERAL,
510             SMALLINT_LITERAL,
511             INTEGER_LITERAL,
512             BIGINT_LITERAL,
513             REAL_LITERAL,
514             FLOAT_LITERAL,
515             DOUBLE_LITERAL,
516             NUMERIC_LITERAL,
517             DECIMAL_LITERAL,
518             CHAR_LITERAL,
519             VARCHAR_LITERAL,
520             LONGVARCHAR_LITERAL,
521             BINARY_LITERAL,
522             VARBINARY_LITERAL,
523             LONGVARBINARY_LITERAL,
524             DATE_LITERAL,
525             TIME_LITERAL,
526             TIMESTAMP_LITERAL,
527         };
528
529     /**
530      * A public read-only list of all the '<em><b>Jdbc Type</b></em>' enumerators.
531      * <!-- begin-user-doc -->
532      * <!-- end-user-doc -->
533      * @generated
534      */

535     public static final List JavaDoc VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
536
537     /**
538      * Returns the '<em><b>Jdbc Type</b></em>' literal with the specified name.
539      * <!-- begin-user-doc -->
540      * <!-- end-user-doc -->
541      * @generated
542      */

543     public static JdbcType get(String JavaDoc name) {
544         for (int i = 0; i < VALUES_ARRAY.length; ++i) {
545             JdbcType result = VALUES_ARRAY[i];
546             if (result.toString().equals(name)) {
547                 return result;
548             }
549         }
550         return null;
551     }
552
553     /**
554      * Returns the '<em><b>Jdbc Type</b></em>' literal with the specified value.
555      * <!-- begin-user-doc -->
556      * <!-- end-user-doc -->
557      * @generated
558      */

559     public static JdbcType get(int value) {
560         switch (value) {
561             case BIT: return BIT_LITERAL;
562             case TINYINT: return TINYINT_LITERAL;
563             case SMALLINT: return SMALLINT_LITERAL;
564             case INTEGER: return INTEGER_LITERAL;
565             case BIGINT: return BIGINT_LITERAL;
566             case REAL: return REAL_LITERAL;
567             case FLOAT: return FLOAT_LITERAL;
568             case DOUBLE: return DOUBLE_LITERAL;
569             case NUMERIC: return NUMERIC_LITERAL;
570             case DECIMAL: return DECIMAL_LITERAL;
571             case CHAR: return CHAR_LITERAL;
572             case VARCHAR: return VARCHAR_LITERAL;
573             case LONGVARCHAR: return LONGVARCHAR_LITERAL;
574             case BINARY: return BINARY_LITERAL;
575             case VARBINARY: return VARBINARY_LITERAL;
576             case LONGVARBINARY: return LONGVARBINARY_LITERAL;
577             case DATE: return DATE_LITERAL;
578             case TIME: return TIME_LITERAL;
579             case TIMESTAMP: return TIMESTAMP_LITERAL;
580         }
581         return null;
582     }
583
584     /**
585      * Only this class can construct instances.
586      * <!-- begin-user-doc -->
587      * <!-- end-user-doc -->
588      * @generated
589      */

590     private JdbcType(int value, String JavaDoc name) {
591         super(value, name);
592     }
593
594 } //JdbcType
595
Popular Tags