| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.impl; |
| 8 | |
| 9 | import de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.DimensionType; |
| 10 | import de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.QMLContractTypePackage; |
| 11 | import de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.RelationSemantics; |
| 12 | |
| 13 | import de.uka.ipd.sdq.identifier.impl.IdentifierImpl; |
| 14 | |
| 15 | import org.eclipse.emf.common.notify.Notification; |
| 16 | import org.eclipse.emf.common.notify.NotificationChain; |
| 17 | |
| 18 | import org.eclipse.emf.ecore.EClass; |
| 19 | import org.eclipse.emf.ecore.InternalEObject; |
| 20 | |
| 21 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 22 | |
| 23 | /** |
| 24 | * <!-- begin-user-doc --> |
| 25 | * An implementation of the model object '<em><b>Dimension Type</b></em>'. |
| 26 | * <!-- end-user-doc --> |
| 27 | * <p> |
| 28 | * The following features are implemented: |
| 29 | * <ul> |
| 30 | * <li>{@link de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.impl.DimensionTypeImpl#getRelationSemantics <em>Relation Semantics</em>}</li> |
| 31 | * </ul> |
| 32 | * </p> |
| 33 | * |
| 34 | * @generated |
| 35 | */ |
| 36 | public abstract class DimensionTypeImpl extends IdentifierImpl implements DimensionType { |
| 37 | /** |
| 38 | * The cached value of the '{@link #getRelationSemantics() <em>Relation Semantics</em>}' containment reference. |
| 39 | * <!-- begin-user-doc --> |
| 40 | * <!-- end-user-doc --> |
| 41 | * @see #getRelationSemantics() |
| 42 | * @generated |
| 43 | * @ordered |
| 44 | */ |
| 45 | protected RelationSemantics relationSemantics; |
| 46 | |
| 47 | /** |
| 48 | * <!-- begin-user-doc --> |
| 49 | * <!-- end-user-doc --> |
| 50 | * @generated |
| 51 | */ |
| 52 | protected DimensionTypeImpl() { |
| 53 | super(); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * <!-- begin-user-doc --> |
| 58 | * <!-- end-user-doc --> |
| 59 | * @generated |
| 60 | */ |
| 61 | @Override |
| 62 | protected EClass eStaticClass() { |
| 63 | return QMLContractTypePackage.Literals.DIMENSION_TYPE; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * <!-- begin-user-doc --> |
| 68 | * <!-- end-user-doc --> |
| 69 | * @generated |
| 70 | */ |
| 71 | public RelationSemantics getRelationSemantics() { |
| 72 | return relationSemantics; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * <!-- begin-user-doc --> |
| 77 | * <!-- end-user-doc --> |
| 78 | * @generated |
| 79 | */ |
| 80 | public NotificationChain basicSetRelationSemantics(RelationSemantics newRelationSemantics, NotificationChain msgs) { |
| 81 | RelationSemantics oldRelationSemantics = relationSemantics; |
| 82 | relationSemantics = newRelationSemantics; |
| 83 | if (eNotificationRequired()) { |
| 84 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS, oldRelationSemantics, newRelationSemantics); |
| 85 | if (msgs == null) msgs = notification; else msgs.add(notification); |
| 86 | } |
| 87 | return msgs; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * <!-- begin-user-doc --> |
| 92 | * <!-- end-user-doc --> |
| 93 | * @generated |
| 94 | */ |
| 95 | public void setRelationSemantics(RelationSemantics newRelationSemantics) { |
| 96 | if (newRelationSemantics != relationSemantics) { |
| 97 | NotificationChain msgs = null; |
| 98 | if (relationSemantics != null) |
| 99 | msgs = ((InternalEObject)relationSemantics).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS, null, msgs); |
| 100 | if (newRelationSemantics != null) |
| 101 | msgs = ((InternalEObject)newRelationSemantics).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS, null, msgs); |
| 102 | msgs = basicSetRelationSemantics(newRelationSemantics, msgs); |
| 103 | if (msgs != null) msgs.dispatch(); |
| 104 | } |
| 105 | else if (eNotificationRequired()) |
| 106 | eNotify(new ENotificationImpl(this, Notification.SET, QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS, newRelationSemantics, newRelationSemantics)); |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * <!-- begin-user-doc --> |
| 111 | * <!-- end-user-doc --> |
| 112 | * @generated |
| 113 | */ |
| 114 | @Override |
| 115 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 116 | switch (featureID) { |
| 117 | case QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS: |
| 118 | return basicSetRelationSemantics(null, msgs); |
| 119 | } |
| 120 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * <!-- begin-user-doc --> |
| 125 | * <!-- end-user-doc --> |
| 126 | * @generated |
| 127 | */ |
| 128 | @Override |
| 129 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 130 | switch (featureID) { |
| 131 | case QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS: |
| 132 | return getRelationSemantics(); |
| 133 | } |
| 134 | return super.eGet(featureID, resolve, coreType); |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * <!-- begin-user-doc --> |
| 139 | * <!-- end-user-doc --> |
| 140 | * @generated |
| 141 | */ |
| 142 | @Override |
| 143 | public void eSet(int featureID, Object newValue) { |
| 144 | switch (featureID) { |
| 145 | case QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS: |
| 146 | setRelationSemantics((RelationSemantics)newValue); |
| 147 | return; |
| 148 | } |
| 149 | super.eSet(featureID, newValue); |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * <!-- begin-user-doc --> |
| 154 | * <!-- end-user-doc --> |
| 155 | * @generated |
| 156 | */ |
| 157 | @Override |
| 158 | public void eUnset(int featureID) { |
| 159 | switch (featureID) { |
| 160 | case QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS: |
| 161 | setRelationSemantics((RelationSemantics)null); |
| 162 | return; |
| 163 | } |
| 164 | super.eUnset(featureID); |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * <!-- begin-user-doc --> |
| 169 | * <!-- end-user-doc --> |
| 170 | * @generated |
| 171 | */ |
| 172 | @Override |
| 173 | public boolean eIsSet(int featureID) { |
| 174 | switch (featureID) { |
| 175 | case QMLContractTypePackage.DIMENSION_TYPE__RELATION_SEMANTICS: |
| 176 | return relationSemantics != null; |
| 177 | } |
| 178 | return super.eIsSet(featureID); |
| 179 | } |
| 180 | |
| 181 | } //DimensionTypeImpl |