| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package edu.kit.ipd.sdq.completionfeaturemodel.impl; |
| 8 | |
| 9 | import org.eclipse.emf.common.notify.Notification; |
| 10 | import org.eclipse.emf.ecore.EClass; |
| 11 | import org.eclipse.emf.ecore.InternalEObject; |
| 12 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 13 | |
| 14 | import de.uka.ipd.sdq.featuremodel.impl.FeatureDiagramImpl; |
| 15 | import edu.kit.ipd.sdq.completionfeaturemodel.CompletionFeatureDiagram; |
| 16 | import edu.kit.ipd.sdq.completionfeaturemodel.completionfeaturemodelPackage; |
| 17 | |
| 18 | /** |
| 19 | * <!-- begin-user-doc --> |
| 20 | * An implementation of the model object '<em><b>Completion Feature Diagram</b></em>'. |
| 21 | * <!-- end-user-doc --> |
| 22 | * <p> |
| 23 | * The following features are implemented: |
| 24 | * <ul> |
| 25 | * <li>{@link edu.kit.ipd.sdq.completionfeaturemodel.impl.CompletionFeatureDiagramImpl#getAnnotatableElementType <em>Annotatable Element Type</em>}</li> |
| 26 | * </ul> |
| 27 | * </p> |
| 28 | * |
| 29 | * @generated |
| 30 | */ |
| 31 | public class CompletionFeatureDiagramImpl extends FeatureDiagramImpl implements CompletionFeatureDiagram { |
| 32 | /** |
| 33 | * The cached value of the '{@link #getAnnotatableElementType() <em>Annotatable Element Type</em>}' reference. |
| 34 | * <!-- begin-user-doc --> |
| 35 | * <!-- end-user-doc --> |
| 36 | * @see #getAnnotatableElementType() |
| 37 | * @generated |
| 38 | * @ordered |
| 39 | */ |
| 40 | protected EClass annotatableElementType; |
| 41 | |
| 42 | /** |
| 43 | * <!-- begin-user-doc --> |
| 44 | * <!-- end-user-doc --> |
| 45 | * @generated |
| 46 | */ |
| 47 | protected CompletionFeatureDiagramImpl() { |
| 48 | super(); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * <!-- begin-user-doc --> |
| 53 | * <!-- end-user-doc --> |
| 54 | * @generated |
| 55 | */ |
| 56 | @Override |
| 57 | protected EClass eStaticClass() { |
| 58 | return completionfeaturemodelPackage.Literals.COMPLETION_FEATURE_DIAGRAM; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * <!-- begin-user-doc --> |
| 63 | * <!-- end-user-doc --> |
| 64 | * @generated |
| 65 | */ |
| 66 | public EClass getAnnotatableElementType() { |
| 67 | if (annotatableElementType != null && annotatableElementType.eIsProxy()) { |
| 68 | InternalEObject oldAnnotatableElementType = (InternalEObject)annotatableElementType; |
| 69 | annotatableElementType = (EClass)eResolveProxy(oldAnnotatableElementType); |
| 70 | if (annotatableElementType != oldAnnotatableElementType) { |
| 71 | if (eNotificationRequired()) |
| 72 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, completionfeaturemodelPackage.COMPLETION_FEATURE_DIAGRAM__ANNOTATABLE_ELEMENT_TYPE, oldAnnotatableElementType, annotatableElementType)); |
| 73 | } |
| 74 | } |
| 75 | return annotatableElementType; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * <!-- begin-user-doc --> |
| 80 | * <!-- end-user-doc --> |
| 81 | * @generated |
| 82 | */ |
| 83 | public EClass basicGetAnnotatableElementType() { |
| 84 | return annotatableElementType; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * <!-- begin-user-doc --> |
| 89 | * <!-- end-user-doc --> |
| 90 | * @generated |
| 91 | */ |
| 92 | public void setAnnotatableElementType(EClass newAnnotatableElementType) { |
| 93 | EClass oldAnnotatableElementType = annotatableElementType; |
| 94 | annotatableElementType = newAnnotatableElementType; |
| 95 | if (eNotificationRequired()) |
| 96 | eNotify(new ENotificationImpl(this, Notification.SET, completionfeaturemodelPackage.COMPLETION_FEATURE_DIAGRAM__ANNOTATABLE_ELEMENT_TYPE, oldAnnotatableElementType, annotatableElementType)); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * <!-- begin-user-doc --> |
| 101 | * <!-- end-user-doc --> |
| 102 | * @generated |
| 103 | */ |
| 104 | @Override |
| 105 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 106 | switch (featureID) { |
| 107 | case completionfeaturemodelPackage.COMPLETION_FEATURE_DIAGRAM__ANNOTATABLE_ELEMENT_TYPE: |
| 108 | if (resolve) return getAnnotatableElementType(); |
| 109 | return basicGetAnnotatableElementType(); |
| 110 | } |
| 111 | return super.eGet(featureID, resolve, coreType); |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * <!-- begin-user-doc --> |
| 116 | * <!-- end-user-doc --> |
| 117 | * @generated |
| 118 | */ |
| 119 | @Override |
| 120 | public void eSet(int featureID, Object newValue) { |
| 121 | switch (featureID) { |
| 122 | case completionfeaturemodelPackage.COMPLETION_FEATURE_DIAGRAM__ANNOTATABLE_ELEMENT_TYPE: |
| 123 | setAnnotatableElementType((EClass)newValue); |
| 124 | return; |
| 125 | } |
| 126 | super.eSet(featureID, newValue); |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * <!-- begin-user-doc --> |
| 131 | * <!-- end-user-doc --> |
| 132 | * @generated |
| 133 | */ |
| 134 | @Override |
| 135 | public void eUnset(int featureID) { |
| 136 | switch (featureID) { |
| 137 | case completionfeaturemodelPackage.COMPLETION_FEATURE_DIAGRAM__ANNOTATABLE_ELEMENT_TYPE: |
| 138 | setAnnotatableElementType((EClass)null); |
| 139 | return; |
| 140 | } |
| 141 | super.eUnset(featureID); |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * <!-- begin-user-doc --> |
| 146 | * <!-- end-user-doc --> |
| 147 | * @generated |
| 148 | */ |
| 149 | @Override |
| 150 | public boolean eIsSet(int featureID) { |
| 151 | switch (featureID) { |
| 152 | case completionfeaturemodelPackage.COMPLETION_FEATURE_DIAGRAM__ANNOTATABLE_ELEMENT_TYPE: |
| 153 | return annotatableElementType != null; |
| 154 | } |
| 155 | return super.eIsSet(featureID); |
| 156 | } |
| 157 | |
| 158 | } //CompletionFeatureDiagramImpl |