KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > reportdefinitions > types > ReportDataType


1 /*
2  * This class was automatically generated with
3  * <a HREF="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4  * Schema.
5  * $Id$
6  */

7
8 package com.calipso.reportgenerator.reportdefinitions.types;
9
10   //---------------------------------/
11
//- Imported classes and packages -/
12
//---------------------------------/
13

14 import java.io.Serializable JavaDoc;
15 import java.util.Enumeration JavaDoc;
16 import java.util.Hashtable JavaDoc;
17 import org.exolab.castor.xml.Marshaller;
18 import org.exolab.castor.xml.Unmarshaller;
19
20 /**
21  * Class ReportDataType.
22  *
23  * @version $Revision$ $Date$
24  */

25 public class ReportDataType implements java.io.Serializable JavaDoc {
26
27
28       //--------------------------/
29
//- Class/Member Variables -/
30
//--------------------------/
31

32     /**
33      * The DATE type
34      */

35     public static final int DATE_TYPE = 0;
36
37     /**
38      * The instance of the DATE type
39      */

40     public static final ReportDataType DATE = new ReportDataType(DATE_TYPE, "DATE");
41
42     /**
43      * The DATETIME type
44      */

45     public static final int DATETIME_TYPE = 1;
46
47     /**
48      * The instance of the DATETIME type
49      */

50     public static final ReportDataType DATETIME = new ReportDataType(DATETIME_TYPE, "DATETIME");
51
52     /**
53      * The STRING type
54      */

55     public static final int STRING_TYPE = 2;
56
57     /**
58      * The instance of the STRING type
59      */

60     public static final ReportDataType STRING = new ReportDataType(STRING_TYPE, "STRING");
61
62     /**
63      * The FLOAT type
64      */

65     public static final int FLOAT_TYPE = 3;
66
67     /**
68      * The instance of the FLOAT type
69      */

70     public static final ReportDataType FLOAT = new ReportDataType(FLOAT_TYPE, "FLOAT");
71
72     /**
73      * The INTEGER type
74      */

75     public static final int INTEGER_TYPE = 4;
76
77     /**
78      * The instance of the INTEGER type
79      */

80     public static final ReportDataType INTEGER = new ReportDataType(INTEGER_TYPE, "INTEGER");
81
82     /**
83      * The BOOLEAN type
84      */

85     public static final int BOOLEAN_TYPE = 5;
86
87     /**
88      * The instance of the BOOLEAN type
89      */

90     public static final ReportDataType BOOLEAN = new ReportDataType(BOOLEAN_TYPE, "BOOLEAN");
91
92     /**
93      * Field _memberTable
94      */

95     private static java.util.Hashtable JavaDoc _memberTable = init();
96
97     /**
98      * Field type
99      */

100     private int type = -1;
101
102     /**
103      * Field stringValue
104      */

105     private java.lang.String JavaDoc stringValue = null;
106
107
108       //----------------/
109
//- Constructors -/
110
//----------------/
111

112     private ReportDataType(int type, java.lang.String JavaDoc value) {
113         super();
114         this.type = type;
115         this.stringValue = value;
116     } //-- com.calipso.reportgenerator.reportdefinitions.types.ReportDataType(int, java.lang.String)
117

118
119       //-----------/
120
//- Methods -/
121
//-----------/
122

123     /**
124      * Method enumerateReturns an enumeration of all possible
125      * instances of ReportDataType
126      */

127     public static java.util.Enumeration JavaDoc enumerate()
128     {
129         return _memberTable.elements();
130     } //-- java.util.Enumeration enumerate()
131

132     /**
133      * Method getTypeReturns the type of this ReportDataType
134      */

135     public int getType()
136     {
137         return this.type;
138     } //-- int getType()
139

140     /**
141      * Method init
142      */

143     private static java.util.Hashtable JavaDoc init()
144     {
145         Hashtable JavaDoc members = new Hashtable JavaDoc();
146         members.put("DATE", DATE);
147         members.put("DATETIME", DATETIME);
148         members.put("STRING", STRING);
149         members.put("FLOAT", FLOAT);
150         members.put("INTEGER", INTEGER);
151         members.put("BOOLEAN", BOOLEAN);
152         return members;
153     } //-- java.util.Hashtable init()
154

155     /**
156      * Method toStringReturns the String representation of this
157      * ReportDataType
158      */

159     public java.lang.String JavaDoc toString()
160     {
161         return this.stringValue;
162     } //-- java.lang.String toString()
163

164     /**
165      * Method valueOfReturns a new ReportDataType based on the
166      * given String value.
167      *
168      * @param string
169      */

170     public static com.calipso.reportgenerator.reportdefinitions.types.ReportDataType valueOf(java.lang.String JavaDoc string)
171     {
172         java.lang.Object JavaDoc obj = null;
173         if (string != null) obj = _memberTable.get(string);
174         if (obj == null) {
175             String JavaDoc err = "'" + string + "' is not a valid ReportDataType";
176             throw new IllegalArgumentException JavaDoc(err);
177         }
178         return (ReportDataType) obj;
179     } //-- com.calipso.reportgenerator.reportdefinitions.types.ReportDataType valueOf(java.lang.String)
180

181 }
182
Popular Tags