KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > DefinitionIncludeTypeImpl


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

7 package Olj.impl;
8
9 import Olj.DefinitionIncludeType;
10 import Olj.IncludeType;
11 import Olj.OljPackage;
12
13 import org.eclipse.emf.common.notify.Notification;
14 import org.eclipse.emf.common.notify.NotificationChain;
15
16 import org.eclipse.emf.ecore.EClass;
17 import org.eclipse.emf.ecore.EStructuralFeature;
18 import org.eclipse.emf.ecore.InternalEObject;
19
20 import org.eclipse.emf.ecore.impl.ENotificationImpl;
21 import org.eclipse.emf.ecore.impl.EObjectImpl;
22
23 /**
24  * <!-- begin-user-doc -->
25  * An implementation of the model object '<em><b>Definition Include Type</b></em>'.
26  * <!-- end-user-doc -->
27  * <p>
28  * The following features are implemented:
29  * <ul>
30  * <li>{@link Olj.impl.DefinitionIncludeTypeImpl#getInclude <em>Include</em>}</li>
31  * </ul>
32  * </p>
33  *
34  * @generated
35  */

36 public class DefinitionIncludeTypeImpl extends EObjectImpl implements DefinitionIncludeType {
37     /**
38      * The cached value of the '{@link #getInclude() <em>Include</em>}' containment reference.
39      * <!-- begin-user-doc -->
40      * <!-- end-user-doc -->
41      * @see #getInclude()
42      * @generated
43      * @ordered
44      */

45     protected IncludeType include = null;
46
47     /**
48      * <!-- begin-user-doc -->
49      * <!-- end-user-doc -->
50      * @generated
51      */

52     protected DefinitionIncludeTypeImpl() {
53         super();
54     }
55
56     /**
57      * <!-- begin-user-doc -->
58      * <!-- end-user-doc -->
59      * @generated
60      */

61     protected EClass eStaticClass() {
62         return OljPackage.eINSTANCE.getDefinitionIncludeType();
63     }
64
65     /**
66      * <!-- begin-user-doc -->
67      * <!-- end-user-doc -->
68      * @generated
69      */

70     public IncludeType getInclude() {
71         return include;
72     }
73
74     /**
75      * <!-- begin-user-doc -->
76      * <!-- end-user-doc -->
77      * @generated
78      */

79     public NotificationChain basicSetInclude(IncludeType newInclude, NotificationChain msgs) {
80         IncludeType oldInclude = include;
81         include = newInclude;
82         if (eNotificationRequired()) {
83             ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE, oldInclude, newInclude);
84             if (msgs == null) msgs = notification; else msgs.add(notification);
85         }
86         return msgs;
87     }
88
89     /**
90      * <!-- begin-user-doc -->
91      * <!-- end-user-doc -->
92      * @generated
93      */

94     public void setInclude(IncludeType newInclude) {
95         if (newInclude != include) {
96             NotificationChain msgs = null;
97             if (include != null)
98                 msgs = ((InternalEObject)include).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE, null, msgs);
99             if (newInclude != null)
100                 msgs = ((InternalEObject)newInclude).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE, null, msgs);
101             msgs = basicSetInclude(newInclude, msgs);
102             if (msgs != null) msgs.dispatch();
103         }
104         else if (eNotificationRequired())
105             eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE, newInclude, newInclude));
106     }
107
108     /**
109      * <!-- begin-user-doc -->
110      * <!-- end-user-doc -->
111      * @generated
112      */

113     public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs) {
114         if (featureID >= 0) {
115             switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
116                 case OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE:
117                     return basicSetInclude(null, msgs);
118                 default:
119                     return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
120             }
121         }
122         return eBasicSetContainer(null, featureID, msgs);
123     }
124
125     /**
126      * <!-- begin-user-doc -->
127      * <!-- end-user-doc -->
128      * @generated
129      */

130     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
131         switch (eDerivedStructuralFeatureID(eFeature)) {
132             case OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE:
133                 return getInclude();
134         }
135         return eDynamicGet(eFeature, resolve);
136     }
137
138     /**
139      * <!-- begin-user-doc -->
140      * <!-- end-user-doc -->
141      * @generated
142      */

143     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
144         switch (eDerivedStructuralFeatureID(eFeature)) {
145             case OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE:
146                 setInclude((IncludeType)newValue);
147                 return;
148         }
149         eDynamicSet(eFeature, newValue);
150     }
151
152     /**
153      * <!-- begin-user-doc -->
154      * <!-- end-user-doc -->
155      * @generated
156      */

157     public void eUnset(EStructuralFeature eFeature) {
158         switch (eDerivedStructuralFeatureID(eFeature)) {
159             case OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE:
160                 setInclude((IncludeType)null);
161                 return;
162         }
163         eDynamicUnset(eFeature);
164     }
165
166     /**
167      * <!-- begin-user-doc -->
168      * <!-- end-user-doc -->
169      * @generated
170      */

171     public boolean eIsSet(EStructuralFeature eFeature) {
172         switch (eDerivedStructuralFeatureID(eFeature)) {
173             case OljPackage.DEFINITION_INCLUDE_TYPE__INCLUDE:
174                 return include != null;
175         }
176         return eDynamicIsSet(eFeature);
177     }
178
179 } //DefinitionIncludeTypeImpl
180
Popular Tags