1 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 36 public class DefinitionIncludeTypeImpl extends EObjectImpl implements DefinitionIncludeType { 37 45 protected IncludeType include = null; 46 47 52 protected DefinitionIncludeTypeImpl() { 53 super(); 54 } 55 56 61 protected EClass eStaticClass() { 62 return OljPackage.eINSTANCE.getDefinitionIncludeType(); 63 } 64 65 70 public IncludeType getInclude() { 71 return include; 72 } 73 74 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 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 113 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class 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 130 public Object 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 143 public void eSet(EStructuralFeature eFeature, Object 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 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 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 } | Popular Tags |