| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.featuremodel.impl; |
| 8 | |
| 9 | import java.util.Collection; |
| 10 | import java.util.Map; |
| 11 | |
| 12 | import org.eclipse.emf.common.notify.Notification; |
| 13 | import org.eclipse.emf.common.notify.NotificationChain; |
| 14 | import org.eclipse.emf.common.util.BasicDiagnostic; |
| 15 | import org.eclipse.emf.common.util.Diagnostic; |
| 16 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 17 | import org.eclipse.emf.common.util.EList; |
| 18 | import org.eclipse.emf.ecore.EClass; |
| 19 | import org.eclipse.emf.ecore.InternalEObject; |
| 20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 21 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 22 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| 23 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 24 | import org.eclipse.emf.ecore.util.EcoreUtil; |
| 25 | import org.eclipse.emf.ecore.util.InternalEList; |
| 26 | import org.eclipse.ocl.ParserException; |
| 27 | import org.eclipse.ocl.ecore.Constraint; |
| 28 | import org.eclipse.ocl.ecore.OCL; |
| 29 | |
| 30 | import de.uka.ipd.sdq.featuremodel.Attribute; |
| 31 | import de.uka.ipd.sdq.featuremodel.ChildRelation; |
| 32 | import de.uka.ipd.sdq.featuremodel.Feature; |
| 33 | import de.uka.ipd.sdq.featuremodel.FeatureGroup; |
| 34 | import de.uka.ipd.sdq.featuremodel.Simple; |
| 35 | import de.uka.ipd.sdq.featuremodel.featuremodelPackage; |
| 36 | import de.uka.ipd.sdq.featuremodel.util.featuremodelValidator; |
| 37 | |
| 38 | /** |
| 39 | * <!-- begin-user-doc --> An implementation of the model object ' |
| 40 | * <em><b>Feature</b></em>'. <!-- end-user-doc --> |
| 41 | * <p> |
| 42 | * The following features are implemented: |
| 43 | * <ul> |
| 44 | * <li>{@link de.uka.ipd.sdq.featuremodel.impl.FeatureImpl#getAttributes <em>Attributes</em>}</li> |
| 45 | * <li>{@link de.uka.ipd.sdq.featuremodel.impl.FeatureImpl#getChildrelation <em>Childrelation</em>}</li> |
| 46 | * <li>{@link de.uka.ipd.sdq.featuremodel.impl.FeatureImpl#getSimpleMandatory <em>Simple Mandatory</em>}</li> |
| 47 | * <li>{@link de.uka.ipd.sdq.featuremodel.impl.FeatureImpl#getSimpleOptional <em>Simple Optional</em>}</li> |
| 48 | * <li>{@link de.uka.ipd.sdq.featuremodel.impl.FeatureImpl#getFeaturegroup <em>Featuregroup</em>}</li> |
| 49 | * </ul> |
| 50 | * </p> |
| 51 | * |
| 52 | * @generated |
| 53 | */ |
| 54 | public class FeatureImpl extends NamedElementImpl implements Feature { |
| 55 | /** |
| 56 | * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list. |
| 57 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 58 | * @see #getAttributes() |
| 59 | * @generated |
| 60 | * @ordered |
| 61 | */ |
| 62 | protected EList<Attribute> attributes; |
| 63 | |
| 64 | /** |
| 65 | * The cached value of the '{@link #getChildrelation() <em>Childrelation</em>}' containment reference. |
| 66 | * <!-- begin-user-doc --> |
| 67 | * <!-- end-user-doc --> |
| 68 | * @see #getChildrelation() |
| 69 | * @generated |
| 70 | * @ordered |
| 71 | */ |
| 72 | protected ChildRelation childrelation; |
| 73 | |
| 74 | /** |
| 75 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 76 | * @generated |
| 77 | */ |
| 78 | protected FeatureImpl() { |
| 79 | super(); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 84 | * @generated |
| 85 | */ |
| 86 | @Override |
| 87 | protected EClass eStaticClass() { |
| 88 | return featuremodelPackage.Literals.FEATURE; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 93 | * @generated |
| 94 | */ |
| 95 | public EList<Attribute> getAttributes() { |
| 96 | if (attributes == null) { |
| 97 | attributes = new EObjectContainmentEList<Attribute>(Attribute.class, this, featuremodelPackage.FEATURE__ATTRIBUTES); |
| 98 | } |
| 99 | return attributes; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 104 | * @generated |
| 105 | */ |
| 106 | public ChildRelation getChildrelation() { |
| 107 | return childrelation; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 112 | * @generated |
| 113 | */ |
| 114 | public NotificationChain basicSetChildrelation( |
| 115 | ChildRelation newChildrelation, NotificationChain msgs) { |
| 116 | ChildRelation oldChildrelation = childrelation; |
| 117 | childrelation = newChildrelation; |
| 118 | if (eNotificationRequired()) { |
| 119 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, featuremodelPackage.FEATURE__CHILDRELATION, oldChildrelation, newChildrelation); |
| 120 | if (msgs == null) msgs = notification; else msgs.add(notification); |
| 121 | } |
| 122 | return msgs; |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 127 | * @generated |
| 128 | */ |
| 129 | public void setChildrelation(ChildRelation newChildrelation) { |
| 130 | if (newChildrelation != childrelation) { |
| 131 | NotificationChain msgs = null; |
| 132 | if (childrelation != null) |
| 133 | msgs = ((InternalEObject)childrelation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - featuremodelPackage.FEATURE__CHILDRELATION, null, msgs); |
| 134 | if (newChildrelation != null) |
| 135 | msgs = ((InternalEObject)newChildrelation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - featuremodelPackage.FEATURE__CHILDRELATION, null, msgs); |
| 136 | msgs = basicSetChildrelation(newChildrelation, msgs); |
| 137 | if (msgs != null) msgs.dispatch(); |
| 138 | } |
| 139 | else if (eNotificationRequired()) |
| 140 | eNotify(new ENotificationImpl(this, Notification.SET, featuremodelPackage.FEATURE__CHILDRELATION, newChildrelation, newChildrelation)); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 145 | * @generated |
| 146 | */ |
| 147 | public Simple getSimpleMandatory() { |
| 148 | if (eContainerFeatureID() != featuremodelPackage.FEATURE__SIMPLE_MANDATORY) return null; |
| 149 | return (Simple)eContainer(); |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 154 | * @generated |
| 155 | */ |
| 156 | public NotificationChain basicSetSimpleMandatory(Simple newSimpleMandatory, |
| 157 | NotificationChain msgs) { |
| 158 | msgs = eBasicSetContainer((InternalEObject)newSimpleMandatory, featuremodelPackage.FEATURE__SIMPLE_MANDATORY, msgs); |
| 159 | return msgs; |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 164 | * @generated |
| 165 | */ |
| 166 | public void setSimpleMandatory(Simple newSimpleMandatory) { |
| 167 | if (newSimpleMandatory != eInternalContainer() || (eContainerFeatureID() != featuremodelPackage.FEATURE__SIMPLE_MANDATORY && newSimpleMandatory != null)) { |
| 168 | if (EcoreUtil.isAncestor(this, newSimpleMandatory)) |
| 169 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 170 | NotificationChain msgs = null; |
| 171 | if (eInternalContainer() != null) |
| 172 | msgs = eBasicRemoveFromContainer(msgs); |
| 173 | if (newSimpleMandatory != null) |
| 174 | msgs = ((InternalEObject)newSimpleMandatory).eInverseAdd(this, featuremodelPackage.SIMPLE__MANDATORY_CHILDREN, Simple.class, msgs); |
| 175 | msgs = basicSetSimpleMandatory(newSimpleMandatory, msgs); |
| 176 | if (msgs != null) msgs.dispatch(); |
| 177 | } |
| 178 | else if (eNotificationRequired()) |
| 179 | eNotify(new ENotificationImpl(this, Notification.SET, featuremodelPackage.FEATURE__SIMPLE_MANDATORY, newSimpleMandatory, newSimpleMandatory)); |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 184 | * @generated |
| 185 | */ |
| 186 | public Simple getSimpleOptional() { |
| 187 | if (eContainerFeatureID() != featuremodelPackage.FEATURE__SIMPLE_OPTIONAL) return null; |
| 188 | return (Simple)eContainer(); |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 193 | * @generated |
| 194 | */ |
| 195 | public NotificationChain basicSetSimpleOptional(Simple newSimpleOptional, |
| 196 | NotificationChain msgs) { |
| 197 | msgs = eBasicSetContainer((InternalEObject)newSimpleOptional, featuremodelPackage.FEATURE__SIMPLE_OPTIONAL, msgs); |
| 198 | return msgs; |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 203 | * @generated |
| 204 | */ |
| 205 | public void setSimpleOptional(Simple newSimpleOptional) { |
| 206 | if (newSimpleOptional != eInternalContainer() || (eContainerFeatureID() != featuremodelPackage.FEATURE__SIMPLE_OPTIONAL && newSimpleOptional != null)) { |
| 207 | if (EcoreUtil.isAncestor(this, newSimpleOptional)) |
| 208 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 209 | NotificationChain msgs = null; |
| 210 | if (eInternalContainer() != null) |
| 211 | msgs = eBasicRemoveFromContainer(msgs); |
| 212 | if (newSimpleOptional != null) |
| 213 | msgs = ((InternalEObject)newSimpleOptional).eInverseAdd(this, featuremodelPackage.SIMPLE__OPTIONAL_CHILDREN, Simple.class, msgs); |
| 214 | msgs = basicSetSimpleOptional(newSimpleOptional, msgs); |
| 215 | if (msgs != null) msgs.dispatch(); |
| 216 | } |
| 217 | else if (eNotificationRequired()) |
| 218 | eNotify(new ENotificationImpl(this, Notification.SET, featuremodelPackage.FEATURE__SIMPLE_OPTIONAL, newSimpleOptional, newSimpleOptional)); |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * <!-- begin-user-doc --> |
| 223 | * <!-- end-user-doc --> |
| 224 | * @generated |
| 225 | */ |
| 226 | public FeatureGroup getFeaturegroup() { |
| 227 | if (eContainerFeatureID() != featuremodelPackage.FEATURE__FEATUREGROUP) return null; |
| 228 | return (FeatureGroup)eContainer(); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * <!-- begin-user-doc --> |
| 233 | * <!-- end-user-doc --> |
| 234 | * @generated |
| 235 | */ |
| 236 | public NotificationChain basicSetFeaturegroup(FeatureGroup newFeaturegroup, NotificationChain msgs) { |
| 237 | msgs = eBasicSetContainer((InternalEObject)newFeaturegroup, featuremodelPackage.FEATURE__FEATUREGROUP, msgs); |
| 238 | return msgs; |
| 239 | } |
| 240 | |
| 241 | /** |
| 242 | * <!-- begin-user-doc --> |
| 243 | * <!-- end-user-doc --> |
| 244 | * @generated |
| 245 | */ |
| 246 | public void setFeaturegroup(FeatureGroup newFeaturegroup) { |
| 247 | if (newFeaturegroup != eInternalContainer() || (eContainerFeatureID() != featuremodelPackage.FEATURE__FEATUREGROUP && newFeaturegroup != null)) { |
| 248 | if (EcoreUtil.isAncestor(this, newFeaturegroup)) |
| 249 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 250 | NotificationChain msgs = null; |
| 251 | if (eInternalContainer() != null) |
| 252 | msgs = eBasicRemoveFromContainer(msgs); |
| 253 | if (newFeaturegroup != null) |
| 254 | msgs = ((InternalEObject)newFeaturegroup).eInverseAdd(this, featuremodelPackage.FEATURE_GROUP__CHILDREN, FeatureGroup.class, msgs); |
| 255 | msgs = basicSetFeaturegroup(newFeaturegroup, msgs); |
| 256 | if (msgs != null) msgs.dispatch(); |
| 257 | } |
| 258 | else if (eNotificationRequired()) |
| 259 | eNotify(new ENotificationImpl(this, Notification.SET, featuremodelPackage.FEATURE__FEATUREGROUP, newFeaturegroup, newFeaturegroup)); |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * The cached OCL expression body for the '{@link #EachAttributeNameDefinedJustOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Each Attribute Name Defined Just Once</em>}' operation. |
| 264 | * <!-- begin-user-doc --> |
| 265 | * <!-- end-user-doc --> |
| 266 | * @see #EachAttributeNameDefinedJustOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 267 | * @generated |
| 268 | * @ordered |
| 269 | */ |
| 270 | protected static final String EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "true "+ |
| 271 | "--each attribute name is unique for this feature"+ |
| 272 | "--self.attributes->isUnique(attr | attr.name)"; |
| 273 | |
| 274 | /** |
| 275 | * The cached OCL invariant for the '{@link #EachAttributeNameDefinedJustOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Each Attribute Name Defined Just Once</em>}' invariant operation. |
| 276 | * <!-- begin-user-doc --> |
| 277 | * <!-- end-user-doc --> |
| 278 | * @see #EachAttributeNameDefinedJustOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 279 | * @generated |
| 280 | * @ordered |
| 281 | */ |
| 282 | protected static Constraint EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 283 | |
| 284 | /** |
| 285 | * <!-- begin-user-doc --> |
| 286 | * <!-- end-user-doc --> |
| 287 | * @generated |
| 288 | */ |
| 289 | public boolean EachAttributeNameDefinedJustOnce(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 290 | if (EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 291 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 292 | helper.setContext(featuremodelPackage.Literals.FEATURE); |
| 293 | try { |
| 294 | EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 295 | } |
| 296 | catch (ParserException pe) { |
| 297 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 298 | } |
| 299 | } |
| 300 | if (!EOCL_ENV.createQuery(EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 301 | if (diagnostics != null) { |
| 302 | diagnostics.add |
| 303 | (new BasicDiagnostic |
| 304 | (Diagnostic.ERROR, |
| 305 | featuremodelValidator.DIAGNOSTIC_SOURCE, |
| 306 | featuremodelValidator.FEATURE__EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE, |
| 307 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "EachAttributeNameDefinedJustOnce", EObjectValidator.getObjectLabel(this, context) }), |
| 308 | new Object [] { this })); |
| 309 | } |
| 310 | return false; |
| 311 | } |
| 312 | return true; |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 317 | * @generated |
| 318 | */ |
| 319 | @Override |
| 320 | public NotificationChain eInverseAdd(InternalEObject otherEnd, |
| 321 | int featureID, NotificationChain msgs) { |
| 322 | switch (featureID) { |
| 323 | case featuremodelPackage.FEATURE__SIMPLE_MANDATORY: |
| 324 | if (eInternalContainer() != null) |
| 325 | msgs = eBasicRemoveFromContainer(msgs); |
| 326 | return basicSetSimpleMandatory((Simple)otherEnd, msgs); |
| 327 | case featuremodelPackage.FEATURE__SIMPLE_OPTIONAL: |
| 328 | if (eInternalContainer() != null) |
| 329 | msgs = eBasicRemoveFromContainer(msgs); |
| 330 | return basicSetSimpleOptional((Simple)otherEnd, msgs); |
| 331 | case featuremodelPackage.FEATURE__FEATUREGROUP: |
| 332 | if (eInternalContainer() != null) |
| 333 | msgs = eBasicRemoveFromContainer(msgs); |
| 334 | return basicSetFeaturegroup((FeatureGroup)otherEnd, msgs); |
| 335 | } |
| 336 | return super.eInverseAdd(otherEnd, featureID, msgs); |
| 337 | } |
| 338 | |
| 339 | /** |
| 340 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 341 | * @generated |
| 342 | */ |
| 343 | @Override |
| 344 | public NotificationChain eInverseRemove(InternalEObject otherEnd, |
| 345 | int featureID, NotificationChain msgs) { |
| 346 | switch (featureID) { |
| 347 | case featuremodelPackage.FEATURE__ATTRIBUTES: |
| 348 | return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs); |
| 349 | case featuremodelPackage.FEATURE__CHILDRELATION: |
| 350 | return basicSetChildrelation(null, msgs); |
| 351 | case featuremodelPackage.FEATURE__SIMPLE_MANDATORY: |
| 352 | return basicSetSimpleMandatory(null, msgs); |
| 353 | case featuremodelPackage.FEATURE__SIMPLE_OPTIONAL: |
| 354 | return basicSetSimpleOptional(null, msgs); |
| 355 | case featuremodelPackage.FEATURE__FEATUREGROUP: |
| 356 | return basicSetFeaturegroup(null, msgs); |
| 357 | } |
| 358 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 359 | } |
| 360 | |
| 361 | /** |
| 362 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 363 | * @generated |
| 364 | */ |
| 365 | @Override |
| 366 | public NotificationChain eBasicRemoveFromContainerFeature( |
| 367 | NotificationChain msgs) { |
| 368 | switch (eContainerFeatureID()) { |
| 369 | case featuremodelPackage.FEATURE__SIMPLE_MANDATORY: |
| 370 | return eInternalContainer().eInverseRemove(this, featuremodelPackage.SIMPLE__MANDATORY_CHILDREN, Simple.class, msgs); |
| 371 | case featuremodelPackage.FEATURE__SIMPLE_OPTIONAL: |
| 372 | return eInternalContainer().eInverseRemove(this, featuremodelPackage.SIMPLE__OPTIONAL_CHILDREN, Simple.class, msgs); |
| 373 | case featuremodelPackage.FEATURE__FEATUREGROUP: |
| 374 | return eInternalContainer().eInverseRemove(this, featuremodelPackage.FEATURE_GROUP__CHILDREN, FeatureGroup.class, msgs); |
| 375 | } |
| 376 | return super.eBasicRemoveFromContainerFeature(msgs); |
| 377 | } |
| 378 | |
| 379 | /** |
| 380 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 381 | * @generated |
| 382 | */ |
| 383 | @Override |
| 384 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 385 | switch (featureID) { |
| 386 | case featuremodelPackage.FEATURE__ATTRIBUTES: |
| 387 | return getAttributes(); |
| 388 | case featuremodelPackage.FEATURE__CHILDRELATION: |
| 389 | return getChildrelation(); |
| 390 | case featuremodelPackage.FEATURE__SIMPLE_MANDATORY: |
| 391 | return getSimpleMandatory(); |
| 392 | case featuremodelPackage.FEATURE__SIMPLE_OPTIONAL: |
| 393 | return getSimpleOptional(); |
| 394 | case featuremodelPackage.FEATURE__FEATUREGROUP: |
| 395 | return getFeaturegroup(); |
| 396 | } |
| 397 | return super.eGet(featureID, resolve, coreType); |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 402 | * @generated |
| 403 | */ |
| 404 | @SuppressWarnings("unchecked") |
| 405 | @Override |
| 406 | public void eSet(int featureID, Object newValue) { |
| 407 | switch (featureID) { |
| 408 | case featuremodelPackage.FEATURE__ATTRIBUTES: |
| 409 | getAttributes().clear(); |
| 410 | getAttributes().addAll((Collection<? extends Attribute>)newValue); |
| 411 | return; |
| 412 | case featuremodelPackage.FEATURE__CHILDRELATION: |
| 413 | setChildrelation((ChildRelation)newValue); |
| 414 | return; |
| 415 | case featuremodelPackage.FEATURE__SIMPLE_MANDATORY: |
| 416 | setSimpleMandatory((Simple)newValue); |
| 417 | return; |
| 418 | case featuremodelPackage.FEATURE__SIMPLE_OPTIONAL: |
| 419 | setSimpleOptional((Simple)newValue); |
| 420 | return; |
| 421 | case featuremodelPackage.FEATURE__FEATUREGROUP: |
| 422 | setFeaturegroup((FeatureGroup)newValue); |
| 423 | return; |
| 424 | } |
| 425 | super.eSet(featureID, newValue); |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 430 | * @generated |
| 431 | */ |
| 432 | @Override |
| 433 | public void eUnset(int featureID) { |
| 434 | switch (featureID) { |
| 435 | case featuremodelPackage.FEATURE__ATTRIBUTES: |
| 436 | getAttributes().clear(); |
| 437 | return; |
| 438 | case featuremodelPackage.FEATURE__CHILDRELATION: |
| 439 | setChildrelation((ChildRelation)null); |
| 440 | return; |
| 441 | case featuremodelPackage.FEATURE__SIMPLE_MANDATORY: |
| 442 | setSimpleMandatory((Simple)null); |
| 443 | return; |
| 444 | case featuremodelPackage.FEATURE__SIMPLE_OPTIONAL: |
| 445 | setSimpleOptional((Simple)null); |
| 446 | return; |
| 447 | case featuremodelPackage.FEATURE__FEATUREGROUP: |
| 448 | setFeaturegroup((FeatureGroup)null); |
| 449 | return; |
| 450 | } |
| 451 | super.eUnset(featureID); |
| 452 | } |
| 453 | |
| 454 | /** |
| 455 | * <!-- begin-user-doc --> <!-- end-user-doc --> |
| 456 | * @generated |
| 457 | */ |
| 458 | @Override |
| 459 | public boolean eIsSet(int featureID) { |
| 460 | switch (featureID) { |
| 461 | case featuremodelPackage.FEATURE__ATTRIBUTES: |
| 462 | return attributes != null && !attributes.isEmpty(); |
| 463 | case featuremodelPackage.FEATURE__CHILDRELATION: |
| 464 | return childrelation != null; |
| 465 | case featuremodelPackage.FEATURE__SIMPLE_MANDATORY: |
| 466 | return getSimpleMandatory() != null; |
| 467 | case featuremodelPackage.FEATURE__SIMPLE_OPTIONAL: |
| 468 | return getSimpleOptional() != null; |
| 469 | case featuremodelPackage.FEATURE__FEATUREGROUP: |
| 470 | return getFeaturegroup() != null; |
| 471 | } |
| 472 | return super.eIsSet(featureID); |
| 473 | } |
| 474 | |
| 475 | /** |
| 476 | * The cached environment for evaluating OCL expressions. |
| 477 | * <!-- begin-user-doc --> |
| 478 | * <!-- end-user-doc --> |
| 479 | * @generated |
| 480 | * @ordered |
| 481 | */ |
| 482 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
| 483 | |
| 484 | } // FeatureImpl |