1 7 package Olj.impl; 8 9 import Olj.IncludeType; 10 import Olj.JavaScriptType; 11 import Olj.OljPackage; 12 13 import java.util.Collection ; 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 41 public class JavaScriptTypeImpl extends EObjectImpl implements JavaScriptType { 42 50 protected FeatureMap mixed = null; 51 52 57 protected JavaScriptTypeImpl() { 58 super(); 59 } 60 61 66 protected EClass eStaticClass() { 67 return OljPackage.eINSTANCE.getJavaScriptType(); 68 } 69 70 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 87 public IncludeType getInclude() { 88 return (IncludeType)getMixed().get(OljPackage.eINSTANCE.getJavaScriptType_Include(), true); 89 } 90 91 96 public NotificationChain basicSetInclude(IncludeType newInclude, NotificationChain msgs) { 97 return ((FeatureMap.Internal)getMixed()).basicAdd(OljPackage.eINSTANCE.getJavaScriptType_Include(), newInclude, null); 98 } 99 100 105 public void setInclude(IncludeType newInclude) { 106 ((FeatureMap.Internal)getMixed()).set(OljPackage.eINSTANCE.getJavaScriptType_Include(), newInclude); 107 } 108 109 114 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class 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 133 public Object 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 148 public void eSet(EStructuralFeature eFeature, Object newValue) { 149 switch (eDerivedStructuralFeatureID(eFeature)) { 150 case OljPackage.JAVA_SCRIPT_TYPE__MIXED: 151 getMixed().clear(); 152 getMixed().addAll((Collection )newValue); 153 return; 154 case OljPackage.JAVA_SCRIPT_TYPE__INCLUDE: 155 setInclude((IncludeType)newValue); 156 return; 157 } 158 eDynamicSet(eFeature, newValue); 159 } 160 161 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 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 198 public String toString() { 199 if (eIsProxy()) return super.toString(); 200 201 StringBuffer result = new StringBuffer (super.toString()); 202 result.append(" (mixed: "); 203 result.append(mixed); 204 result.append(')'); 205 return result.toString(); 206 } 207 208 } | Popular Tags |