KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > SubCounterColumnTypeImpl


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

7 package Olj.impl;
8
9 import Olj.OljPackage;
10 import Olj.SubCounterColumnType;
11 import Olj.SubCounterKeyColumnType;
12 import Olj.ValueModeType2;
13
14 import java.util.Collection JavaDoc;
15
16 import org.eclipse.emf.common.notify.Notification;
17 import org.eclipse.emf.common.notify.NotificationChain;
18
19 import org.eclipse.emf.common.util.EList;
20
21 import org.eclipse.emf.ecore.EClass;
22 import org.eclipse.emf.ecore.EStructuralFeature;
23 import org.eclipse.emf.ecore.InternalEObject;
24
25 import org.eclipse.emf.ecore.impl.ENotificationImpl;
26 import org.eclipse.emf.ecore.impl.EObjectImpl;
27
28 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
29 import org.eclipse.emf.ecore.util.InternalEList;
30
31 /**
32  * <!-- begin-user-doc -->
33  * An implementation of the model object '<em><b>Sub Counter Column Type</b></em>'.
34  * <!-- end-user-doc -->
35  * <p>
36  * The following features are implemented:
37  * <ul>
38  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getSubCounterKeyColumn <em>Sub Counter Key Column</em>}</li>
39  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getCounterIncrement <em>Counter Increment</em>}</li>
40  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getCounterName <em>Counter Name</em>}</li>
41  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getCounterStartValue <em>Counter Start Value</em>}</li>
42  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getTargetColumnName <em>Target Column Name</em>}</li>
43  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getTargetTableID <em>Target Table ID</em>}</li>
44  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getTargetTableName <em>Target Table Name</em>}</li>
45  * <li>{@link Olj.impl.SubCounterColumnTypeImpl#getValueMode <em>Value Mode</em>}</li>
46  * </ul>
47  * </p>
48  *
49  * @generated
50  */

51 public class SubCounterColumnTypeImpl extends EObjectImpl implements SubCounterColumnType {
52     /**
53      * The cached value of the '{@link #getSubCounterKeyColumn() <em>Sub Counter Key Column</em>}' containment reference list.
54      * <!-- begin-user-doc -->
55      * <!-- end-user-doc -->
56      * @see #getSubCounterKeyColumn()
57      * @generated
58      * @ordered
59      */

60     protected EList subCounterKeyColumn = null;
61
62     /**
63      * The default value of the '{@link #getCounterIncrement() <em>Counter Increment</em>}' attribute.
64      * <!-- begin-user-doc -->
65      * <!-- end-user-doc -->
66      * @see #getCounterIncrement()
67      * @generated
68      * @ordered
69      */

70     protected static final String JavaDoc COUNTER_INCREMENT_EDEFAULT = null;
71
72     /**
73      * The cached value of the '{@link #getCounterIncrement() <em>Counter Increment</em>}' attribute.
74      * <!-- begin-user-doc -->
75      * <!-- end-user-doc -->
76      * @see #getCounterIncrement()
77      * @generated
78      * @ordered
79      */

80     protected String JavaDoc counterIncrement = COUNTER_INCREMENT_EDEFAULT;
81
82     /**
83      * The default value of the '{@link #getCounterName() <em>Counter Name</em>}' attribute.
84      * <!-- begin-user-doc -->
85      * <!-- end-user-doc -->
86      * @see #getCounterName()
87      * @generated
88      * @ordered
89      */

90     protected static final String JavaDoc COUNTER_NAME_EDEFAULT = null;
91
92     /**
93      * The cached value of the '{@link #getCounterName() <em>Counter Name</em>}' attribute.
94      * <!-- begin-user-doc -->
95      * <!-- end-user-doc -->
96      * @see #getCounterName()
97      * @generated
98      * @ordered
99      */

100     protected String JavaDoc counterName = COUNTER_NAME_EDEFAULT;
101
102     /**
103      * The default value of the '{@link #getCounterStartValue() <em>Counter Start Value</em>}' attribute.
104      * <!-- begin-user-doc -->
105      * <!-- end-user-doc -->
106      * @see #getCounterStartValue()
107      * @generated
108      * @ordered
109      */

110     protected static final String JavaDoc COUNTER_START_VALUE_EDEFAULT = null;
111
112     /**
113      * The cached value of the '{@link #getCounterStartValue() <em>Counter Start Value</em>}' attribute.
114      * <!-- begin-user-doc -->
115      * <!-- end-user-doc -->
116      * @see #getCounterStartValue()
117      * @generated
118      * @ordered
119      */

120     protected String JavaDoc counterStartValue = COUNTER_START_VALUE_EDEFAULT;
121
122     /**
123      * The default value of the '{@link #getTargetColumnName() <em>Target Column Name</em>}' attribute.
124      * <!-- begin-user-doc -->
125      * <!-- end-user-doc -->
126      * @see #getTargetColumnName()
127      * @generated
128      * @ordered
129      */

130     protected static final String JavaDoc TARGET_COLUMN_NAME_EDEFAULT = null;
131
132     /**
133      * The cached value of the '{@link #getTargetColumnName() <em>Target Column Name</em>}' attribute.
134      * <!-- begin-user-doc -->
135      * <!-- end-user-doc -->
136      * @see #getTargetColumnName()
137      * @generated
138      * @ordered
139      */

140     protected String JavaDoc targetColumnName = TARGET_COLUMN_NAME_EDEFAULT;
141
142     /**
143      * The default value of the '{@link #getTargetTableID() <em>Target Table ID</em>}' attribute.
144      * <!-- begin-user-doc -->
145      * <!-- end-user-doc -->
146      * @see #getTargetTableID()
147      * @generated
148      * @ordered
149      */

150     protected static final String JavaDoc TARGET_TABLE_ID_EDEFAULT = null;
151
152     /**
153      * The cached value of the '{@link #getTargetTableID() <em>Target Table ID</em>}' attribute.
154      * <!-- begin-user-doc -->
155      * <!-- end-user-doc -->
156      * @see #getTargetTableID()
157      * @generated
158      * @ordered
159      */

160     protected String JavaDoc targetTableID = TARGET_TABLE_ID_EDEFAULT;
161
162     /**
163      * The default value of the '{@link #getTargetTableName() <em>Target Table Name</em>}' attribute.
164      * <!-- begin-user-doc -->
165      * <!-- end-user-doc -->
166      * @see #getTargetTableName()
167      * @generated
168      * @ordered
169      */

170     protected static final String JavaDoc TARGET_TABLE_NAME_EDEFAULT = null;
171
172     /**
173      * The cached value of the '{@link #getTargetTableName() <em>Target Table Name</em>}' attribute.
174      * <!-- begin-user-doc -->
175      * <!-- end-user-doc -->
176      * @see #getTargetTableName()
177      * @generated
178      * @ordered
179      */

180     protected String JavaDoc targetTableName = TARGET_TABLE_NAME_EDEFAULT;
181
182     /**
183      * The default value of the '{@link #getValueMode() <em>Value Mode</em>}' attribute.
184      * <!-- begin-user-doc -->
185      * <!-- end-user-doc -->
186      * @see #getValueMode()
187      * @generated
188      * @ordered
189      */

190     protected static final ValueModeType2 VALUE_MODE_EDEFAULT = ValueModeType2.SET_IF_CREATED_LITERAL;
191
192     /**
193      * The cached value of the '{@link #getValueMode() <em>Value Mode</em>}' attribute.
194      * <!-- begin-user-doc -->
195      * <!-- end-user-doc -->
196      * @see #getValueMode()
197      * @generated
198      * @ordered
199      */

200     protected ValueModeType2 valueMode = VALUE_MODE_EDEFAULT;
201
202     /**
203      * This is true if the Value Mode attribute has been set.
204      * <!-- begin-user-doc -->
205      * <!-- end-user-doc -->
206      * @generated
207      * @ordered
208      */

209     protected boolean valueModeESet = false;
210
211     /**
212      * <!-- begin-user-doc -->
213      * <!-- end-user-doc -->
214      * @generated
215      */

216     protected SubCounterColumnTypeImpl() {
217         super();
218     }
219
220     /**
221      * <!-- begin-user-doc -->
222      * <!-- end-user-doc -->
223      * @generated
224      */

225     protected EClass eStaticClass() {
226         return OljPackage.eINSTANCE.getSubCounterColumnType();
227     }
228
229     /**
230      * <!-- begin-user-doc -->
231      * <!-- end-user-doc -->
232      * @generated
233      */

234     public EList getSubCounterKeyColumn() {
235         if (subCounterKeyColumn == null) {
236             subCounterKeyColumn = new EObjectContainmentEList(SubCounterKeyColumnType.class, this, OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN);
237         }
238         return subCounterKeyColumn;
239     }
240
241     /**
242      * <!-- begin-user-doc -->
243      * <!-- end-user-doc -->
244      * @generated
245      */

246     public String JavaDoc getCounterIncrement() {
247         return counterIncrement;
248     }
249
250     /**
251      * <!-- begin-user-doc -->
252      * <!-- end-user-doc -->
253      * @generated
254      */

255     public void setCounterIncrement(String JavaDoc newCounterIncrement) {
256         String JavaDoc oldCounterIncrement = counterIncrement;
257         counterIncrement = newCounterIncrement;
258         if (eNotificationRequired())
259             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT, oldCounterIncrement, counterIncrement));
260     }
261
262     /**
263      * <!-- begin-user-doc -->
264      * <!-- end-user-doc -->
265      * @generated
266      */

267     public String JavaDoc getCounterName() {
268         return counterName;
269     }
270
271     /**
272      * <!-- begin-user-doc -->
273      * <!-- end-user-doc -->
274      * @generated
275      */

276     public void setCounterName(String JavaDoc newCounterName) {
277         String JavaDoc oldCounterName = counterName;
278         counterName = newCounterName;
279         if (eNotificationRequired())
280             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME, oldCounterName, counterName));
281     }
282
283     /**
284      * <!-- begin-user-doc -->
285      * <!-- end-user-doc -->
286      * @generated
287      */

288     public String JavaDoc getCounterStartValue() {
289         return counterStartValue;
290     }
291
292     /**
293      * <!-- begin-user-doc -->
294      * <!-- end-user-doc -->
295      * @generated
296      */

297     public void setCounterStartValue(String JavaDoc newCounterStartValue) {
298         String JavaDoc oldCounterStartValue = counterStartValue;
299         counterStartValue = newCounterStartValue;
300         if (eNotificationRequired())
301             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE, oldCounterStartValue, counterStartValue));
302     }
303
304     /**
305      * <!-- begin-user-doc -->
306      * <!-- end-user-doc -->
307      * @generated
308      */

309     public String JavaDoc getTargetColumnName() {
310         return targetColumnName;
311     }
312
313     /**
314      * <!-- begin-user-doc -->
315      * <!-- end-user-doc -->
316      * @generated
317      */

318     public void setTargetColumnName(String JavaDoc newTargetColumnName) {
319         String JavaDoc oldTargetColumnName = targetColumnName;
320         targetColumnName = newTargetColumnName;
321         if (eNotificationRequired())
322             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME, oldTargetColumnName, targetColumnName));
323     }
324
325     /**
326      * <!-- begin-user-doc -->
327      * <!-- end-user-doc -->
328      * @generated
329      */

330     public String JavaDoc getTargetTableID() {
331         return targetTableID;
332     }
333
334     /**
335      * <!-- begin-user-doc -->
336      * <!-- end-user-doc -->
337      * @generated
338      */

339     public void setTargetTableID(String JavaDoc newTargetTableID) {
340         String JavaDoc oldTargetTableID = targetTableID;
341         targetTableID = newTargetTableID;
342         if (eNotificationRequired())
343             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID, oldTargetTableID, targetTableID));
344     }
345
346     /**
347      * <!-- begin-user-doc -->
348      * <!-- end-user-doc -->
349      * @generated
350      */

351     public String JavaDoc getTargetTableName() {
352         return targetTableName;
353     }
354
355     /**
356      * <!-- begin-user-doc -->
357      * <!-- end-user-doc -->
358      * @generated
359      */

360     public void setTargetTableName(String JavaDoc newTargetTableName) {
361         String JavaDoc oldTargetTableName = targetTableName;
362         targetTableName = newTargetTableName;
363         if (eNotificationRequired())
364             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME, oldTargetTableName, targetTableName));
365     }
366
367     /**
368      * <!-- begin-user-doc -->
369      * <!-- end-user-doc -->
370      * @generated
371      */

372     public ValueModeType2 getValueMode() {
373         return valueMode;
374     }
375
376     /**
377      * <!-- begin-user-doc -->
378      * <!-- end-user-doc -->
379      * @generated
380      */

381     public void setValueMode(ValueModeType2 newValueMode) {
382         ValueModeType2 oldValueMode = valueMode;
383         valueMode = newValueMode == null ? VALUE_MODE_EDEFAULT : newValueMode;
384         boolean oldValueModeESet = valueModeESet;
385         valueModeESet = true;
386         if (eNotificationRequired())
387             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE, oldValueMode, valueMode, !oldValueModeESet));
388     }
389
390     /**
391      * <!-- begin-user-doc -->
392      * <!-- end-user-doc -->
393      * @generated
394      */

395     public void unsetValueMode() {
396         ValueModeType2 oldValueMode = valueMode;
397         boolean oldValueModeESet = valueModeESet;
398         valueMode = VALUE_MODE_EDEFAULT;
399         valueModeESet = false;
400         if (eNotificationRequired())
401             eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE, oldValueMode, VALUE_MODE_EDEFAULT, oldValueModeESet));
402     }
403
404     /**
405      * <!-- begin-user-doc -->
406      * <!-- end-user-doc -->
407      * @generated
408      */

409     public boolean isSetValueMode() {
410         return valueModeESet;
411     }
412
413     /**
414      * <!-- begin-user-doc -->
415      * <!-- end-user-doc -->
416      * @generated
417      */

418     public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs) {
419         if (featureID >= 0) {
420             switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
421                 case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN:
422                     return ((InternalEList)getSubCounterKeyColumn()).basicRemove(otherEnd, msgs);
423                 default:
424                     return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
425             }
426         }
427         return eBasicSetContainer(null, featureID, msgs);
428     }
429
430     /**
431      * <!-- begin-user-doc -->
432      * <!-- end-user-doc -->
433      * @generated
434      */

435     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
436         switch (eDerivedStructuralFeatureID(eFeature)) {
437             case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN:
438                 return getSubCounterKeyColumn();
439             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT:
440                 return getCounterIncrement();
441             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME:
442                 return getCounterName();
443             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE:
444                 return getCounterStartValue();
445             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME:
446                 return getTargetColumnName();
447             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID:
448                 return getTargetTableID();
449             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME:
450                 return getTargetTableName();
451             case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE:
452                 return getValueMode();
453         }
454         return eDynamicGet(eFeature, resolve);
455     }
456
457     /**
458      * <!-- begin-user-doc -->
459      * <!-- end-user-doc -->
460      * @generated
461      */

462     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
463         switch (eDerivedStructuralFeatureID(eFeature)) {
464             case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN:
465                 getSubCounterKeyColumn().clear();
466                 getSubCounterKeyColumn().addAll((Collection JavaDoc)newValue);
467                 return;
468             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT:
469                 setCounterIncrement((String JavaDoc)newValue);
470                 return;
471             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME:
472                 setCounterName((String JavaDoc)newValue);
473                 return;
474             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE:
475                 setCounterStartValue((String JavaDoc)newValue);
476                 return;
477             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME:
478                 setTargetColumnName((String JavaDoc)newValue);
479                 return;
480             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID:
481                 setTargetTableID((String JavaDoc)newValue);
482                 return;
483             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME:
484                 setTargetTableName((String JavaDoc)newValue);
485                 return;
486             case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE:
487                 setValueMode((ValueModeType2)newValue);
488                 return;
489         }
490         eDynamicSet(eFeature, newValue);
491     }
492
493     /**
494      * <!-- begin-user-doc -->
495      * <!-- end-user-doc -->
496      * @generated
497      */

498     public void eUnset(EStructuralFeature eFeature) {
499         switch (eDerivedStructuralFeatureID(eFeature)) {
500             case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN:
501                 getSubCounterKeyColumn().clear();
502                 return;
503             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT:
504                 setCounterIncrement(COUNTER_INCREMENT_EDEFAULT);
505                 return;
506             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME:
507                 setCounterName(COUNTER_NAME_EDEFAULT);
508                 return;
509             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE:
510                 setCounterStartValue(COUNTER_START_VALUE_EDEFAULT);
511                 return;
512             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME:
513                 setTargetColumnName(TARGET_COLUMN_NAME_EDEFAULT);
514                 return;
515             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID:
516                 setTargetTableID(TARGET_TABLE_ID_EDEFAULT);
517                 return;
518             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME:
519                 setTargetTableName(TARGET_TABLE_NAME_EDEFAULT);
520                 return;
521             case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE:
522                 unsetValueMode();
523                 return;
524         }
525         eDynamicUnset(eFeature);
526     }
527
528     /**
529      * <!-- begin-user-doc -->
530      * <!-- end-user-doc -->
531      * @generated
532      */

533     public boolean eIsSet(EStructuralFeature eFeature) {
534         switch (eDerivedStructuralFeatureID(eFeature)) {
535             case OljPackage.SUB_COUNTER_COLUMN_TYPE__SUB_COUNTER_KEY_COLUMN:
536                 return subCounterKeyColumn != null && !subCounterKeyColumn.isEmpty();
537             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_INCREMENT:
538                 return COUNTER_INCREMENT_EDEFAULT == null ? counterIncrement != null : !COUNTER_INCREMENT_EDEFAULT.equals(counterIncrement);
539             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_NAME:
540                 return COUNTER_NAME_EDEFAULT == null ? counterName != null : !COUNTER_NAME_EDEFAULT.equals(counterName);
541             case OljPackage.SUB_COUNTER_COLUMN_TYPE__COUNTER_START_VALUE:
542                 return COUNTER_START_VALUE_EDEFAULT == null ? counterStartValue != null : !COUNTER_START_VALUE_EDEFAULT.equals(counterStartValue);
543             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_COLUMN_NAME:
544                 return TARGET_COLUMN_NAME_EDEFAULT == null ? targetColumnName != null : !TARGET_COLUMN_NAME_EDEFAULT.equals(targetColumnName);
545             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_ID:
546                 return TARGET_TABLE_ID_EDEFAULT == null ? targetTableID != null : !TARGET_TABLE_ID_EDEFAULT.equals(targetTableID);
547             case OljPackage.SUB_COUNTER_COLUMN_TYPE__TARGET_TABLE_NAME:
548                 return TARGET_TABLE_NAME_EDEFAULT == null ? targetTableName != null : !TARGET_TABLE_NAME_EDEFAULT.equals(targetTableName);
549             case OljPackage.SUB_COUNTER_COLUMN_TYPE__VALUE_MODE:
550                 return isSetValueMode();
551         }
552         return eDynamicIsSet(eFeature);
553     }
554
555     /**
556      * <!-- begin-user-doc -->
557      * <!-- end-user-doc -->
558      * @generated
559      */

560     public String JavaDoc toString() {
561         if (eIsProxy()) return super.toString();
562
563         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
564         result.append(" (counterIncrement: ");
565         result.append(counterIncrement);
566         result.append(", counterName: ");
567         result.append(counterName);
568         result.append(", counterStartValue: ");
569         result.append(counterStartValue);
570         result.append(", targetColumnName: ");
571         result.append(targetColumnName);
572         result.append(", targetTableID: ");
573         result.append(targetTableID);
574         result.append(", targetTableName: ");
575         result.append(targetTableName);
576         result.append(", valueMode: ");
577         if (valueModeESet) result.append(valueMode); else result.append("<unset>");
578         result.append(')');
579         return result.toString();
580     }
581
582 } //SubCounterColumnTypeImpl
583
Popular Tags