KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > CounterColumnsTypeImpl


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

7 package Olj.impl;
8
9 import Olj.CounterColumnsType;
10 import Olj.OljPackage;
11
12 import java.util.Collection JavaDoc;
13
14 import org.eclipse.emf.common.notify.Notification;
15 import org.eclipse.emf.common.notify.NotificationChain;
16
17 import org.eclipse.emf.common.util.EList;
18
19 import org.eclipse.emf.ecore.EClass;
20 import org.eclipse.emf.ecore.EStructuralFeature;
21 import org.eclipse.emf.ecore.InternalEObject;
22
23 import org.eclipse.emf.ecore.impl.ENotificationImpl;
24 import org.eclipse.emf.ecore.impl.EObjectImpl;
25
26 import org.eclipse.emf.ecore.util.BasicFeatureMap;
27 import org.eclipse.emf.ecore.util.FeatureMap;
28 import org.eclipse.emf.ecore.util.InternalEList;
29
30 /**
31  * <!-- begin-user-doc -->
32  * An implementation of the model object '<em><b>Counter Columns Type</b></em>'.
33  * <!-- end-user-doc -->
34  * <p>
35  * The following features are implemented:
36  * <ul>
37  * <li>{@link Olj.impl.CounterColumnsTypeImpl#getGroup <em>Group</em>}</li>
38  * <li>{@link Olj.impl.CounterColumnsTypeImpl#getCounterColumn <em>Counter Column</em>}</li>
39  * <li>{@link Olj.impl.CounterColumnsTypeImpl#getSubCounterColumn <em>Sub Counter Column</em>}</li>
40  * <li>{@link Olj.impl.CounterColumnsTypeImpl#getCounterNameColumn <em>Counter Name Column</em>}</li>
41  * <li>{@link Olj.impl.CounterColumnsTypeImpl#getCounterTableName <em>Counter Table Name</em>}</li>
42  * <li>{@link Olj.impl.CounterColumnsTypeImpl#getCounterValueColumn <em>Counter Value Column</em>}</li>
43  * </ul>
44  * </p>
45  *
46  * @generated
47  */

48 public class CounterColumnsTypeImpl extends EObjectImpl implements CounterColumnsType {
49     /**
50      * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
51      * <!-- begin-user-doc -->
52      * <!-- end-user-doc -->
53      * @see #getGroup()
54      * @generated
55      * @ordered
56      */

57     protected FeatureMap group = null;
58
59     /**
60      * The default value of the '{@link #getCounterNameColumn() <em>Counter Name Column</em>}' attribute.
61      * <!-- begin-user-doc -->
62      * <!-- end-user-doc -->
63      * @see #getCounterNameColumn()
64      * @generated
65      * @ordered
66      */

67     protected static final String JavaDoc COUNTER_NAME_COLUMN_EDEFAULT = null;
68
69     /**
70      * The cached value of the '{@link #getCounterNameColumn() <em>Counter Name Column</em>}' attribute.
71      * <!-- begin-user-doc -->
72      * <!-- end-user-doc -->
73      * @see #getCounterNameColumn()
74      * @generated
75      * @ordered
76      */

77     protected String JavaDoc counterNameColumn = COUNTER_NAME_COLUMN_EDEFAULT;
78
79     /**
80      * The default value of the '{@link #getCounterTableName() <em>Counter Table Name</em>}' attribute.
81      * <!-- begin-user-doc -->
82      * <!-- end-user-doc -->
83      * @see #getCounterTableName()
84      * @generated
85      * @ordered
86      */

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

97     protected String JavaDoc counterTableName = COUNTER_TABLE_NAME_EDEFAULT;
98
99     /**
100      * The default value of the '{@link #getCounterValueColumn() <em>Counter Value Column</em>}' attribute.
101      * <!-- begin-user-doc -->
102      * <!-- end-user-doc -->
103      * @see #getCounterValueColumn()
104      * @generated
105      * @ordered
106      */

107     protected static final String JavaDoc COUNTER_VALUE_COLUMN_EDEFAULT = null;
108
109     /**
110      * The cached value of the '{@link #getCounterValueColumn() <em>Counter Value Column</em>}' attribute.
111      * <!-- begin-user-doc -->
112      * <!-- end-user-doc -->
113      * @see #getCounterValueColumn()
114      * @generated
115      * @ordered
116      */

117     protected String JavaDoc counterValueColumn = COUNTER_VALUE_COLUMN_EDEFAULT;
118
119     /**
120      * <!-- begin-user-doc -->
121      * <!-- end-user-doc -->
122      * @generated
123      */

124     protected CounterColumnsTypeImpl() {
125         super();
126     }
127
128     /**
129      * <!-- begin-user-doc -->
130      * <!-- end-user-doc -->
131      * @generated
132      */

133     protected EClass eStaticClass() {
134         return OljPackage.eINSTANCE.getCounterColumnsType();
135     }
136
137     /**
138      * <!-- begin-user-doc -->
139      * <!-- end-user-doc -->
140      * @generated
141      */

142     public FeatureMap getGroup() {
143         if (group == null) {
144             group = new BasicFeatureMap(this, OljPackage.COUNTER_COLUMNS_TYPE__GROUP);
145         }
146         return group;
147     }
148
149     /**
150      * <!-- begin-user-doc -->
151      * <!-- end-user-doc -->
152      * @generated
153      */

154     public EList getCounterColumn() {
155         return ((FeatureMap)getGroup()).list(OljPackage.eINSTANCE.getCounterColumnsType_CounterColumn());
156     }
157
158     /**
159      * <!-- begin-user-doc -->
160      * <!-- end-user-doc -->
161      * @generated
162      */

163     public EList getSubCounterColumn() {
164         return ((FeatureMap)getGroup()).list(OljPackage.eINSTANCE.getCounterColumnsType_SubCounterColumn());
165     }
166
167     /**
168      * <!-- begin-user-doc -->
169      * <!-- end-user-doc -->
170      * @generated
171      */

172     public String JavaDoc getCounterNameColumn() {
173         return counterNameColumn;
174     }
175
176     /**
177      * <!-- begin-user-doc -->
178      * <!-- end-user-doc -->
179      * @generated
180      */

181     public void setCounterNameColumn(String JavaDoc newCounterNameColumn) {
182         String JavaDoc oldCounterNameColumn = counterNameColumn;
183         counterNameColumn = newCounterNameColumn;
184         if (eNotificationRequired())
185             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_NAME_COLUMN, oldCounterNameColumn, counterNameColumn));
186     }
187
188     /**
189      * <!-- begin-user-doc -->
190      * <!-- end-user-doc -->
191      * @generated
192      */

193     public String JavaDoc getCounterTableName() {
194         return counterTableName;
195     }
196
197     /**
198      * <!-- begin-user-doc -->
199      * <!-- end-user-doc -->
200      * @generated
201      */

202     public void setCounterTableName(String JavaDoc newCounterTableName) {
203         String JavaDoc oldCounterTableName = counterTableName;
204         counterTableName = newCounterTableName;
205         if (eNotificationRequired())
206             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_TABLE_NAME, oldCounterTableName, counterTableName));
207     }
208
209     /**
210      * <!-- begin-user-doc -->
211      * <!-- end-user-doc -->
212      * @generated
213      */

214     public String JavaDoc getCounterValueColumn() {
215         return counterValueColumn;
216     }
217
218     /**
219      * <!-- begin-user-doc -->
220      * <!-- end-user-doc -->
221      * @generated
222      */

223     public void setCounterValueColumn(String JavaDoc newCounterValueColumn) {
224         String JavaDoc oldCounterValueColumn = counterValueColumn;
225         counterValueColumn = newCounterValueColumn;
226         if (eNotificationRequired())
227             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_VALUE_COLUMN, oldCounterValueColumn, counterValueColumn));
228     }
229
230     /**
231      * <!-- begin-user-doc -->
232      * <!-- end-user-doc -->
233      * @generated
234      */

235     public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs) {
236         if (featureID >= 0) {
237             switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
238                 case OljPackage.COUNTER_COLUMNS_TYPE__GROUP:
239                     return ((InternalEList)getGroup()).basicRemove(otherEnd, msgs);
240                 case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_COLUMN:
241                     return ((InternalEList)getCounterColumn()).basicRemove(otherEnd, msgs);
242                 case OljPackage.COUNTER_COLUMNS_TYPE__SUB_COUNTER_COLUMN:
243                     return ((InternalEList)getSubCounterColumn()).basicRemove(otherEnd, msgs);
244                 default:
245                     return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
246             }
247         }
248         return eBasicSetContainer(null, featureID, msgs);
249     }
250
251     /**
252      * <!-- begin-user-doc -->
253      * <!-- end-user-doc -->
254      * @generated
255      */

256     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
257         switch (eDerivedStructuralFeatureID(eFeature)) {
258             case OljPackage.COUNTER_COLUMNS_TYPE__GROUP:
259                 return getGroup();
260             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_COLUMN:
261                 return getCounterColumn();
262             case OljPackage.COUNTER_COLUMNS_TYPE__SUB_COUNTER_COLUMN:
263                 return getSubCounterColumn();
264             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_NAME_COLUMN:
265                 return getCounterNameColumn();
266             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_TABLE_NAME:
267                 return getCounterTableName();
268             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_VALUE_COLUMN:
269                 return getCounterValueColumn();
270         }
271         return eDynamicGet(eFeature, resolve);
272     }
273
274     /**
275      * <!-- begin-user-doc -->
276      * <!-- end-user-doc -->
277      * @generated
278      */

279     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
280         switch (eDerivedStructuralFeatureID(eFeature)) {
281             case OljPackage.COUNTER_COLUMNS_TYPE__GROUP:
282                 getGroup().clear();
283                 getGroup().addAll((Collection JavaDoc)newValue);
284                 return;
285             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_COLUMN:
286                 getCounterColumn().clear();
287                 getCounterColumn().addAll((Collection JavaDoc)newValue);
288                 return;
289             case OljPackage.COUNTER_COLUMNS_TYPE__SUB_COUNTER_COLUMN:
290                 getSubCounterColumn().clear();
291                 getSubCounterColumn().addAll((Collection JavaDoc)newValue);
292                 return;
293             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_NAME_COLUMN:
294                 setCounterNameColumn((String JavaDoc)newValue);
295                 return;
296             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_TABLE_NAME:
297                 setCounterTableName((String JavaDoc)newValue);
298                 return;
299             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_VALUE_COLUMN:
300                 setCounterValueColumn((String JavaDoc)newValue);
301                 return;
302         }
303         eDynamicSet(eFeature, newValue);
304     }
305
306     /**
307      * <!-- begin-user-doc -->
308      * <!-- end-user-doc -->
309      * @generated
310      */

311     public void eUnset(EStructuralFeature eFeature) {
312         switch (eDerivedStructuralFeatureID(eFeature)) {
313             case OljPackage.COUNTER_COLUMNS_TYPE__GROUP:
314                 getGroup().clear();
315                 return;
316             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_COLUMN:
317                 getCounterColumn().clear();
318                 return;
319             case OljPackage.COUNTER_COLUMNS_TYPE__SUB_COUNTER_COLUMN:
320                 getSubCounterColumn().clear();
321                 return;
322             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_NAME_COLUMN:
323                 setCounterNameColumn(COUNTER_NAME_COLUMN_EDEFAULT);
324                 return;
325             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_TABLE_NAME:
326                 setCounterTableName(COUNTER_TABLE_NAME_EDEFAULT);
327                 return;
328             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_VALUE_COLUMN:
329                 setCounterValueColumn(COUNTER_VALUE_COLUMN_EDEFAULT);
330                 return;
331         }
332         eDynamicUnset(eFeature);
333     }
334
335     /**
336      * <!-- begin-user-doc -->
337      * <!-- end-user-doc -->
338      * @generated
339      */

340     public boolean eIsSet(EStructuralFeature eFeature) {
341         switch (eDerivedStructuralFeatureID(eFeature)) {
342             case OljPackage.COUNTER_COLUMNS_TYPE__GROUP:
343                 return group != null && !group.isEmpty();
344             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_COLUMN:
345                 return !getCounterColumn().isEmpty();
346             case OljPackage.COUNTER_COLUMNS_TYPE__SUB_COUNTER_COLUMN:
347                 return !getSubCounterColumn().isEmpty();
348             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_NAME_COLUMN:
349                 return COUNTER_NAME_COLUMN_EDEFAULT == null ? counterNameColumn != null : !COUNTER_NAME_COLUMN_EDEFAULT.equals(counterNameColumn);
350             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_TABLE_NAME:
351                 return COUNTER_TABLE_NAME_EDEFAULT == null ? counterTableName != null : !COUNTER_TABLE_NAME_EDEFAULT.equals(counterTableName);
352             case OljPackage.COUNTER_COLUMNS_TYPE__COUNTER_VALUE_COLUMN:
353                 return COUNTER_VALUE_COLUMN_EDEFAULT == null ? counterValueColumn != null : !COUNTER_VALUE_COLUMN_EDEFAULT.equals(counterValueColumn);
354         }
355         return eDynamicIsSet(eFeature);
356     }
357
358     /**
359      * <!-- begin-user-doc -->
360      * <!-- end-user-doc -->
361      * @generated
362      */

363     public String JavaDoc toString() {
364         if (eIsProxy()) return super.toString();
365
366         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
367         result.append(" (group: ");
368         result.append(group);
369         result.append(", counterNameColumn: ");
370         result.append(counterNameColumn);
371         result.append(", counterTableName: ");
372         result.append(counterTableName);
373         result.append(", counterValueColumn: ");
374         result.append(counterValueColumn);
375         result.append(')');
376         return result.toString();
377     }
378
379 } //CounterColumnsTypeImpl
380
Popular Tags