KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Olj > impl > SqlStmtTypeImpl


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

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

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

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

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

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

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

89     public FeatureMap getGroup() {
90         return (FeatureMap)((FeatureMap)getMixed()).list(OljPackage.eINSTANCE.getSqlStmtType_Group());
91     }
92
93     /**
94      * <!-- begin-user-doc -->
95      * <!-- end-user-doc -->
96      * @generated
97      */

98     public EList getInclude() {
99         return ((FeatureMap)getGroup()).list(OljPackage.eINSTANCE.getSqlStmtType_Include());
100     }
101
102     /**
103      * <!-- begin-user-doc -->
104      * <!-- end-user-doc -->
105      * @generated
106      */

107     public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs) {
108         if (featureID >= 0) {
109             switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
110                 case OljPackage.SQL_STMT_TYPE__MIXED:
111                     return ((InternalEList)getMixed()).basicRemove(otherEnd, msgs);
112                 case OljPackage.SQL_STMT_TYPE__GROUP:
113                     return ((InternalEList)getGroup()).basicRemove(otherEnd, msgs);
114                 case OljPackage.SQL_STMT_TYPE__INCLUDE:
115                     return ((InternalEList)getInclude()).basicRemove(otherEnd, msgs);
116                 default:
117                     return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
118             }
119         }
120         return eBasicSetContainer(null, featureID, msgs);
121     }
122
123     /**
124      * <!-- begin-user-doc -->
125      * <!-- end-user-doc -->
126      * @generated
127      */

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

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

168     public void eUnset(EStructuralFeature eFeature) {
169         switch (eDerivedStructuralFeatureID(eFeature)) {
170             case OljPackage.SQL_STMT_TYPE__MIXED:
171                 getMixed().clear();
172                 return;
173             case OljPackage.SQL_STMT_TYPE__GROUP:
174                 getGroup().clear();
175                 return;
176             case OljPackage.SQL_STMT_TYPE__INCLUDE:
177                 getInclude().clear();
178                 return;
179         }
180         eDynamicUnset(eFeature);
181     }
182
183     /**
184      * <!-- begin-user-doc -->
185      * <!-- end-user-doc -->
186      * @generated
187      */

188     public boolean eIsSet(EStructuralFeature eFeature) {
189         switch (eDerivedStructuralFeatureID(eFeature)) {
190             case OljPackage.SQL_STMT_TYPE__MIXED:
191                 return mixed != null && !mixed.isEmpty();
192             case OljPackage.SQL_STMT_TYPE__GROUP:
193                 return !getGroup().isEmpty();
194             case OljPackage.SQL_STMT_TYPE__INCLUDE:
195                 return !getInclude().isEmpty();
196         }
197         return eDynamicIsSet(eFeature);
198     }
199
200     /**
201      * <!-- begin-user-doc -->
202      * <!-- end-user-doc -->
203      * @generated
204      */

205     public String JavaDoc toString() {
206         if (eIsProxy()) return super.toString();
207
208         StringBuffer JavaDoc result = new StringBuffer JavaDoc(super.toString());
209         result.append(" (mixed: ");
210         result.append(mixed);
211         result.append(')');
212         return result.toString();
213     }
214
215 } //SqlStmtTypeImpl
216
Popular Tags