KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > editor > Doml > impl > TypeTypeImpl


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

7 package org.enhydra.dods.editor.Doml.impl;
8
9 import org.eclipse.emf.common.notify.Notification;
10
11 import org.eclipse.emf.ecore.EClass;
12 import org.eclipse.emf.ecore.EStructuralFeature;
13
14 import org.eclipse.emf.ecore.impl.ENotificationImpl;
15 import org.eclipse.emf.ecore.impl.EObjectImpl;
16
17 import org.enhydra.dods.editor.Doml.DomlPackage;
18 import org.enhydra.dods.editor.Doml.JdbcType;
19 import org.enhydra.dods.editor.Doml.TrueFalse;
20 import org.enhydra.dods.editor.Doml.TypeType;
21
22 /**
23  * <!-- begin-user-doc -->
24  * An implementation of the model object '<em><b>Type Type</b></em>'.
25  * <!-- end-user-doc -->
26  * <p>
27  * The following features are implemented:
28  * <ul>
29  * <li>{@link org.enhydra.dods.editor.Doml.impl.TypeTypeImpl#getCanBeNull <em>Can Be Null</em>}</li>
30  * <li>{@link org.enhydra.dods.editor.Doml.impl.TypeTypeImpl#getDbType <em>Db Type</em>}</li>
31  * <li>{@link org.enhydra.dods.editor.Doml.impl.TypeTypeImpl#getJavaType <em>Java Type</em>}</li>
32  * <li>{@link org.enhydra.dods.editor.Doml.impl.TypeTypeImpl#getSize <em>Size</em>}</li>
33  * </ul>
34  * </p>
35  *
36  * @generated
37  */

38 public class TypeTypeImpl extends EObjectImpl implements TypeType {
39     /**
40      * The default value of the '{@link #getCanBeNull() <em>Can Be Null</em>}' attribute.
41      * <!-- begin-user-doc -->
42      * <!-- end-user-doc -->
43      * @see #getCanBeNull()
44      * @generated
45      * @ordered
46      */

47     protected static final TrueFalse CAN_BE_NULL_EDEFAULT = TrueFalse.FALSE_LITERAL;
48
49     /**
50      * The cached value of the '{@link #getCanBeNull() <em>Can Be Null</em>}' attribute.
51      * <!-- begin-user-doc -->
52      * <!-- end-user-doc -->
53      * @see #getCanBeNull()
54      * @generated
55      * @ordered
56      */

57     protected TrueFalse canBeNull = CAN_BE_NULL_EDEFAULT;
58
59     /**
60      * This is true if the Can Be Null attribute has been set.
61      * <!-- begin-user-doc -->
62      * <!-- end-user-doc -->
63      * @generated
64      * @ordered
65      */

66     protected boolean canBeNullESet = false;
67
68     /**
69      * The default value of the '{@link #getDbType() <em>Db Type</em>}' attribute.
70      * <!-- begin-user-doc -->
71      * <!-- end-user-doc -->
72      * @see #getDbType()
73      * @generated
74      * @ordered
75      */

76     protected static final JdbcType DB_TYPE_EDEFAULT = JdbcType.VARCHAR_LITERAL;
77
78     /**
79      * The cached value of the '{@link #getDbType() <em>Db Type</em>}' attribute.
80      * <!-- begin-user-doc -->
81      * <!-- end-user-doc -->
82      * @see #getDbType()
83      * @generated
84      * @ordered
85      */

86     protected JdbcType dbType = DB_TYPE_EDEFAULT;
87
88     /**
89      * This is true if the Db Type attribute has been set.
90      * <!-- begin-user-doc -->
91      * <!-- end-user-doc -->
92      * @generated
93      * @ordered
94      */

95     protected boolean dbTypeESet = false;
96
97     /**
98      * The default value of the '{@link #getJavaType() <em>Java Type</em>}' attribute.
99      * <!-- begin-user-doc -->
100      * <!-- end-user-doc -->
101      * @see #getJavaType()
102      * @generated
103      * @ordered
104      */

105     protected static final String JavaDoc JAVA_TYPE_EDEFAULT = null;
106
107     /**
108      * The cached value of the '{@link #getJavaType() <em>Java Type</em>}' attribute.
109      * <!-- begin-user-doc -->
110      * <!-- end-user-doc -->
111      * @see #getJavaType()
112      * @generated
113      * @ordered
114      */

115     protected String JavaDoc javaType = JAVA_TYPE_EDEFAULT;
116
117     /**
118      * The default value of the '{@link #getSize() <em>Size</em>}' attribute.
119      * <!-- begin-user-doc -->
120      * <!-- end-user-doc -->
121      * @see #getSize()
122      * @generated
123      * @ordered
124      */

125     protected static final String JavaDoc SIZE_EDEFAULT = "";
126
127     /**
128      * The cached value of the '{@link #getSize() <em>Size</em>}' attribute.
129      * <!-- begin-user-doc -->
130      * <!-- end-user-doc -->
131      * @see #getSize()
132      * @generated
133      * @ordered
134      */

135     protected String JavaDoc size = SIZE_EDEFAULT;
136
137     /**
138      * This is true if the Size attribute has been set.
139      * <!-- begin-user-doc -->
140      * <!-- end-user-doc -->
141      * @generated
142      * @ordered
143      */

144     protected boolean sizeESet = false;
145
146     /**
147      * <!-- begin-user-doc -->
148      * <!-- end-user-doc -->
149      * @generated
150      */

151     protected TypeTypeImpl() {
152         super();
153     }
154
155     /**
156      * <!-- begin-user-doc -->
157      * <!-- end-user-doc -->
158      * @generated
159      */

160     protected EClass eStaticClass() {
161         return DomlPackage.eINSTANCE.getTypeType();
162     }
163
164     /**
165      * <!-- begin-user-doc -->
166      * <!-- end-user-doc -->
167      * @generated
168      */

169     public TrueFalse getCanBeNull() {
170         return canBeNull;
171     }
172
173     /**
174      * <!-- begin-user-doc -->
175      * <!-- end-user-doc -->
176      * @generated
177      */

178     public void setCanBeNull(TrueFalse newCanBeNull) {
179         TrueFalse oldCanBeNull = canBeNull;
180         canBeNull = newCanBeNull == null ? CAN_BE_NULL_EDEFAULT : newCanBeNull;
181         boolean oldCanBeNullESet = canBeNullESet;
182         canBeNullESet = true;
183         if (eNotificationRequired())
184             eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TYPE_TYPE__CAN_BE_NULL, oldCanBeNull, canBeNull, !oldCanBeNullESet));
185     }
186
187     /**
188      * <!-- begin-user-doc -->
189      * <!-- end-user-doc -->
190      * @generated
191      */

192     public void unsetCanBeNull() {
193         TrueFalse oldCanBeNull = canBeNull;
194         boolean oldCanBeNullESet = canBeNullESet;
195         canBeNull = CAN_BE_NULL_EDEFAULT;
196         canBeNullESet = false;
197         if (eNotificationRequired())
198             eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TYPE_TYPE__CAN_BE_NULL, oldCanBeNull, CAN_BE_NULL_EDEFAULT, oldCanBeNullESet));
199     }
200
201     /**
202      * <!-- begin-user-doc -->
203      * <!-- end-user-doc -->
204      * @generated
205      */

206     public boolean isSetCanBeNull() {
207         return canBeNullESet;
208     }
209
210     /**
211      * <!-- begin-user-doc -->
212      * <!-- end-user-doc -->
213      * @generated
214      */

215     public JdbcType getDbType() {
216         return dbType;
217     }
218
219     /**
220      * <!-- begin-user-doc -->
221      * <!-- end-user-doc -->
222      * @generated
223      */

224     public void setDbType(JdbcType newDbType) {
225         JdbcType oldDbType = dbType;
226         dbType = newDbType == null ? DB_TYPE_EDEFAULT : newDbType;
227         boolean oldDbTypeESet = dbTypeESet;
228         dbTypeESet = true;
229         if (eNotificationRequired())
230             eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TYPE_TYPE__DB_TYPE, oldDbType, dbType, !oldDbTypeESet));
231     }
232
233     /**
234      * <!-- begin-user-doc -->
235      * <!-- end-user-doc -->
236      * @generated
237      */

238     public void unsetDbType() {
239         JdbcType oldDbType = dbType;
240         boolean oldDbTypeESet = dbTypeESet;
241         dbType = DB_TYPE_EDEFAULT;
242         dbTypeESet = false;
243         if (eNotificationRequired())
244             eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TYPE_TYPE__DB_TYPE, oldDbType, DB_TYPE_EDEFAULT, oldDbTypeESet));
245     }
246
247     /**
248      * <!-- begin-user-doc -->
249      * <!-- end-user-doc -->
250      * @generated
251      */

252     public boolean isSetDbType() {
253         return dbTypeESet;
254     }
255
256     /**
257      * <!-- begin-user-doc -->
258      * <!-- end-user-doc -->
259      * @generated
260      */

261     public String JavaDoc getJavaType() {
262         return javaType;
263     }
264
265     /**
266      * <!-- begin-user-doc -->
267      * <!-- end-user-doc -->
268      * @generated
269      */

270     public void setJavaType(String JavaDoc newJavaType) {
271         String JavaDoc oldJavaType = javaType;
272         javaType = newJavaType;
273         if (eNotificationRequired())
274             eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TYPE_TYPE__JAVA_TYPE, oldJavaType, javaType));
275     }
276
277     /**
278      * <!-- begin-user-doc -->
279      * <!-- end-user-doc -->
280      * @generated
281      */

282     public String JavaDoc getSize() {
283         return size;
284     }
285
286     /**
287      * <!-- begin-user-doc -->
288      * <!-- end-user-doc -->
289      * @generated
290      */

291     public void setSize(String JavaDoc newSize) {
292         String JavaDoc oldSize = size;
293         size = newSize;
294         boolean oldSizeESet = sizeESet;
295         sizeESet = true;
296         if (eNotificationRequired())
297             eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TYPE_TYPE__SIZE, oldSize, size, !oldSizeESet));
298     }
299
300     /**
301      * <!-- begin-user-doc -->
302      * <!-- end-user-doc -->
303      * @generated
304      */

305     public void unsetSize() {
306         String JavaDoc oldSize = size;
307         boolean oldSizeESet = sizeESet;
308         size = SIZE_EDEFAULT;
309         sizeESet = false;
310         if (eNotificationRequired())
311             eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TYPE_TYPE__SIZE, oldSize, SIZE_EDEFAULT, oldSizeESet));
312     }
313
314     /**
315      * <!-- begin-user-doc -->
316      * <!-- end-user-doc -->
317      * @generated
318      */

319     public boolean isSetSize() {
320         return sizeESet;
321     }
322
323     /**
324      * <!-- begin-user-doc -->
325      * <!-- end-user-doc -->
326      * @generated
327      */

328     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
329         switch (eDerivedStructuralFeatureID(eFeature)) {
330             case DomlPackage.TYPE_TYPE__CAN_BE_NULL:
331                 return getCanBeNull();
332             case DomlPackage.TYPE_TYPE__DB_TYPE:
333                 return getDbType();
334             case DomlPackage.TYPE_TYPE__JAVA_TYPE:
335                 return getJavaType();
336             case DomlPackage.TYPE_TYPE__SIZE:
337                 return getSize();
338         }
339         return eDynamicGet(eFeature, resolve);
340     }
341
342     /**
343      * <!-- begin-user-doc -->
344      * <!-- end-user-doc -->
345      * @generated
346      */

347     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
348         switch (eDerivedStructuralFeatureID(eFeature)) {
349             case DomlPackage.TYPE_TYPE__CAN_BE_NULL:
350                 setCanBeNull((TrueFalse)newValue);
351                 return;
352             case DomlPackage.TYPE_TYPE__DB_TYPE:
353                 setDbType((JdbcType)newValue);
354                 return;
355             case DomlPackage.TYPE_TYPE__JAVA_TYPE:
356                 setJavaType((String JavaDoc)newValue);
357                 return;
358             case DomlPackage.TYPE_TYPE__SIZE:
359                 setSize((String JavaDoc)newValue);
360                 return;
361         }
362         eDynamicSet(eFeature, newValue);
363     }
364
365     /**
366      * <!-- begin-user-doc -->
367      * <!-- end-user-doc -->
368      * @generated
369      */

370     public void eUnset(EStructuralFeature eFeature) {
371         switch (eDerivedStructuralFeatureID(eFeature)) {
372             case DomlPackage.TYPE_TYPE__CAN_BE_NULL:
373                 unsetCanBeNull();
374                 return;
375             case DomlPackage.TYPE_TYPE__DB_TYPE:
376                 unsetDbType();
377                 return;
378             case DomlPackage.TYPE_TYPE__JAVA_TYPE:
379                 setJavaType(JAVA_TYPE_EDEFAULT);
380                 return;
381             case DomlPackage.TYPE_TYPE__SIZE:
382                 unsetSize();
383                 return;
384         }
385         eDynamicUnset(eFeature);
386     }
387
388     /**
389      * <!-- begin-user-doc -->
390      * <!-- end-user-doc -->
391      * @generated
392      */

393     public boolean eIsSet(EStructuralFeature eFeature) {
394         switch (eDerivedStructuralFeatureID(eFeature)) {
395             case DomlPackage.TYPE_TYPE__CAN_BE_NULL:
396                 return isSetCanBeNull();
397             case DomlPackage.TYPE_TYPE__DB_TYPE:
398                 return isSetDbType();
399             case DomlPackage.TYPE_TYPE__JAVA_TYPE:
400                 return JAVA_TYPE_EDEFAULT == null ? javaType != null : !JAVA_TYPE_EDEFAULT.equals(javaType);
401             case DomlPackage.TYPE_TYPE__SIZE:
402                 return isSetSize();
403         }
404         return eDynamicIsSet(eFeature);
405     }
406
407     /**
408      * <!-- begin-user-doc -->
409      * <!-- end-user-doc -->
410      * @generated
411      */

412     public String JavaDoc toString() {
413         if (eIsProxy()) return super.toString();
414
415         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
416         result.append(" (canBeNull: ");
417         if (canBeNullESet) result.append(canBeNull); else result.append("<unset>");
418         result.append(", dbType: ");
419         if (dbTypeESet) result.append(dbType); else result.append("<unset>");
420         result.append(", javaType: ");
421         result.append(javaType);
422         result.append(", size: ");
423         if (sizeESet) result.append(size); else result.append("<unset>");
424         result.append(')');
425         return result.toString();
426     }
427
428 } //TypeTypeImpl
429
Popular Tags