KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > JavaScriptTypeImpl


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

7 package Olj.impl;
8
9 import Olj.IncludeType;
10 import Olj.JavaScriptType;
11 import Olj.OljPackage;
12
13 import java.util.Collection JavaDoc;
14
15 import org.eclipse.emf.common.notify.NotificationChain;
16
17 import org.eclipse.emf.ecore.EClass;
18 import org.eclipse.emf.ecore.EStructuralFeature;
19 import org.eclipse.emf.ecore.InternalEObject;
20
21 import org.eclipse.emf.ecore.impl.EObjectImpl;
22
23 import org.eclipse.emf.ecore.util.BasicFeatureMap;
24 import org.eclipse.emf.ecore.util.FeatureMap;
25 import org.eclipse.emf.ecore.util.InternalEList;
26
27 /**
28  * <!-- begin-user-doc -->
29  * An implementation of the model object '<em><b>Java Script Type</b></em>'.
30  * <!-- end-user-doc -->
31  * <p>
32  * The following features are implemented:
33  * <ul>
34  * <li>{@link Olj.impl.JavaScriptTypeImpl#getMixed <em>Mixed</em>}</li>
35  * <li>{@link Olj.impl.JavaScriptTypeImpl#getInclude <em>Include</em>}</li>
36  * </ul>
37  * </p>
38  *
39  * @generated
40  */

41 public class JavaScriptTypeImpl extends EObjectImpl implements JavaScriptType {
42     /**
43      * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
44      * <!-- begin-user-doc -->
45      * <!-- end-user-doc -->
46      * @see #getMixed()
47      * @generated
48      * @ordered
49      */

50     protected FeatureMap mixed = null;
51
52     /**
53      * <!-- begin-user-doc -->
54      * <!-- end-user-doc -->
55      * @generated
56      */

57     protected JavaScriptTypeImpl() {
58         super();
59     }
60
61     /**
62      * <!-- begin-user-doc -->
63      * <!-- end-user-doc -->
64      * @generated
65      */

66     protected EClass eStaticClass() {
67         return OljPackage.eINSTANCE.getJavaScriptType();
68     }
69
70     /**
71      * <!-- begin-user-doc -->
72      * <!-- end-user-doc -->
73      * @generated
74      */

75     public FeatureMap getMixed() {
76         if (mixed == null) {
77             mixed = new BasicFeatureMap(this, OljPackage.JAVA_SCRIPT_TYPE__MIXED);
78         }
79         return mixed;
80     }
81
82     /**
83      * <!-- begin-user-doc -->
84      * <!-- end-user-doc -->
85      * @generated
86      */

87     public IncludeType getInclude() {
88         return (IncludeType)getMixed().get(OljPackage.eINSTANCE.getJavaScriptType_Include(), true);
89     }
90
91     /**
92      * <!-- begin-user-doc -->
93      * <!-- end-user-doc -->
94      * @generated
95      */

96     public NotificationChain basicSetInclude(IncludeType newInclude, NotificationChain msgs) {
97         return ((FeatureMap.Internal)getMixed()).basicAdd(OljPackage.eINSTANCE.getJavaScriptType_Include(), newInclude, null);
98     }
99
100     /**
101      * <!-- begin-user-doc -->
102      * <!-- end-user-doc -->
103      * @generated
104      */

105     public void setInclude(IncludeType newInclude) {
106         ((FeatureMap.Internal)getMixed()).set(OljPackage.eINSTANCE.getJavaScriptType_Include(), newInclude);
107     }
108
109     /**
110      * <!-- begin-user-doc -->
111      * <!-- end-user-doc -->
112      * @generated
113      */

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

133     public Object JavaDoc eGet(EStructuralFeature eFeature, boolean resolve) {
134         switch (eDerivedStructuralFeatureID(eFeature)) {
135             case OljPackage.JAVA_SCRIPT_TYPE__MIXED:
136                 return getMixed();
137             case OljPackage.JAVA_SCRIPT_TYPE__INCLUDE:
138                 return getInclude();
139         }
140         return eDynamicGet(eFeature, resolve);
141     }
142
143     /**
144      * <!-- begin-user-doc -->
145      * <!-- end-user-doc -->
146      * @generated
147      */

148     public void eSet(EStructuralFeature eFeature, Object JavaDoc newValue) {
149         switch (eDerivedStructuralFeatureID(eFeature)) {
150             case OljPackage.JAVA_SCRIPT_TYPE__MIXED:
151                 getMixed().clear();
152                 getMixed().addAll((Collection JavaDoc)newValue);
153                 return;
154             case OljPackage.JAVA_SCRIPT_TYPE__INCLUDE:
155                 setInclude((IncludeType)newValue);
156                 return;
157         }
158         eDynamicSet(eFeature, newValue);
159     }
160
161     /**
162      * <!-- begin-user-doc -->
163      * <!-- end-user-doc -->
164      * @generated
165      */

166     public void eUnset(EStructuralFeature eFeature) {
167         switch (eDerivedStructuralFeatureID(eFeature)) {
168             case OljPackage.JAVA_SCRIPT_TYPE__MIXED:
169                 getMixed().clear();
170                 return;
171             case OljPackage.JAVA_SCRIPT_TYPE__INCLUDE:
172                 setInclude((IncludeType)null);
173                 return;
174         }
175         eDynamicUnset(eFeature);
176     }
177
178     /**
179      * <!-- begin-user-doc -->
180      * <!-- end-user-doc -->
181      * @generated
182      */

183     public boolean eIsSet(EStructuralFeature eFeature) {
184         switch (eDerivedStructuralFeatureID(eFeature)) {
185             case OljPackage.JAVA_SCRIPT_TYPE__MIXED:
186                 return mixed != null && !mixed.isEmpty();
187             case OljPackage.JAVA_SCRIPT_TYPE__INCLUDE:
188                 return getInclude() != null;
189         }
190         return eDynamicIsSet(eFeature);
191     }
192
193     /**
194      * <!-- begin-user-doc -->
195      * <!-- end-user-doc -->
196      * @generated
197      */

198     public String JavaDoc toString() {
199         if (eIsProxy()) return super.toString();
200
201         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
202         result.append(" (mixed: ");
203         result.append(mixed);
204         result.append(')');
205         return result.toString();
206     }
207
208 } //JavaScriptTypeImpl
209
Popular Tags