| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.fzi.se.quality.impl; |
| 8 | |
| 9 | import de.fzi.se.quality.QualityPackage; |
| 10 | import de.fzi.se.quality.QualityRepository; |
| 11 | import de.fzi.se.quality.QualityStatement; |
| 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 | import org.eclipse.emf.ecore.util.EcoreUtil; |
| 24 | |
| 25 | /** |
| 26 | * <!-- begin-user-doc --> |
| 27 | * An implementation of the model object '<em><b>Statement</b></em>'. |
| 28 | * <!-- end-user-doc --> |
| 29 | * <p> |
| 30 | * The following features are implemented: |
| 31 | * <ul> |
| 32 | * <li>{@link de.fzi.se.quality.impl.QualityStatementImpl#getQualityRepository <em>Quality Repository</em>}</li> |
| 33 | * </ul> |
| 34 | * </p> |
| 35 | * |
| 36 | * @generated |
| 37 | */ |
| 38 | public abstract class QualityStatementImpl extends IdentifierImpl implements QualityStatement { |
| 39 | /** |
| 40 | * <!-- begin-user-doc --> |
| 41 | * <!-- end-user-doc --> |
| 42 | * @generated |
| 43 | */ |
| 44 | protected QualityStatementImpl() { |
| 45 | super(); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * <!-- begin-user-doc --> |
| 50 | * <!-- end-user-doc --> |
| 51 | * @generated |
| 52 | */ |
| 53 | @Override |
| 54 | protected EClass eStaticClass() { |
| 55 | return QualityPackage.Literals.QUALITY_STATEMENT; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * <!-- begin-user-doc --> |
| 60 | * <!-- end-user-doc --> |
| 61 | * @generated |
| 62 | */ |
| 63 | public QualityRepository getQualityRepository() { |
| 64 | if (eContainerFeatureID() != QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY) return null; |
| 65 | return (QualityRepository)eContainer(); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * <!-- begin-user-doc --> |
| 70 | * <!-- end-user-doc --> |
| 71 | * @generated |
| 72 | */ |
| 73 | public NotificationChain basicSetQualityRepository(QualityRepository newQualityRepository, NotificationChain msgs) { |
| 74 | msgs = eBasicSetContainer((InternalEObject)newQualityRepository, QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY, msgs); |
| 75 | return msgs; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * <!-- begin-user-doc --> |
| 80 | * <!-- end-user-doc --> |
| 81 | * @generated |
| 82 | */ |
| 83 | public void setQualityRepository(QualityRepository newQualityRepository) { |
| 84 | if (newQualityRepository != eInternalContainer() || (eContainerFeatureID() != QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY && newQualityRepository != null)) { |
| 85 | if (EcoreUtil.isAncestor(this, newQualityRepository)) |
| 86 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 87 | NotificationChain msgs = null; |
| 88 | if (eInternalContainer() != null) |
| 89 | msgs = eBasicRemoveFromContainer(msgs); |
| 90 | if (newQualityRepository != null) |
| 91 | msgs = ((InternalEObject)newQualityRepository).eInverseAdd(this, QualityPackage.QUALITY_REPOSITORY__QUALITY_STATEMENTS, QualityRepository.class, msgs); |
| 92 | msgs = basicSetQualityRepository(newQualityRepository, msgs); |
| 93 | if (msgs != null) msgs.dispatch(); |
| 94 | } |
| 95 | else if (eNotificationRequired()) |
| 96 | eNotify(new ENotificationImpl(this, Notification.SET, QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY, newQualityRepository, newQualityRepository)); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * <!-- begin-user-doc --> |
| 101 | * <!-- end-user-doc --> |
| 102 | * @generated |
| 103 | */ |
| 104 | @Override |
| 105 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 106 | switch (featureID) { |
| 107 | case QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY: |
| 108 | if (eInternalContainer() != null) |
| 109 | msgs = eBasicRemoveFromContainer(msgs); |
| 110 | return basicSetQualityRepository((QualityRepository)otherEnd, msgs); |
| 111 | } |
| 112 | return super.eInverseAdd(otherEnd, featureID, msgs); |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * <!-- begin-user-doc --> |
| 117 | * <!-- end-user-doc --> |
| 118 | * @generated |
| 119 | */ |
| 120 | @Override |
| 121 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 122 | switch (featureID) { |
| 123 | case QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY: |
| 124 | return basicSetQualityRepository(null, msgs); |
| 125 | } |
| 126 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * <!-- begin-user-doc --> |
| 131 | * <!-- end-user-doc --> |
| 132 | * @generated |
| 133 | */ |
| 134 | @Override |
| 135 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
| 136 | switch (eContainerFeatureID()) { |
| 137 | case QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY: |
| 138 | return eInternalContainer().eInverseRemove(this, QualityPackage.QUALITY_REPOSITORY__QUALITY_STATEMENTS, QualityRepository.class, msgs); |
| 139 | } |
| 140 | return super.eBasicRemoveFromContainerFeature(msgs); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * <!-- begin-user-doc --> |
| 145 | * <!-- end-user-doc --> |
| 146 | * @generated |
| 147 | */ |
| 148 | @Override |
| 149 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 150 | switch (featureID) { |
| 151 | case QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY: |
| 152 | return getQualityRepository(); |
| 153 | } |
| 154 | return super.eGet(featureID, resolve, coreType); |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * <!-- begin-user-doc --> |
| 159 | * <!-- end-user-doc --> |
| 160 | * @generated |
| 161 | */ |
| 162 | @Override |
| 163 | public void eSet(int featureID, Object newValue) { |
| 164 | switch (featureID) { |
| 165 | case QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY: |
| 166 | setQualityRepository((QualityRepository)newValue); |
| 167 | return; |
| 168 | } |
| 169 | super.eSet(featureID, newValue); |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * <!-- begin-user-doc --> |
| 174 | * <!-- end-user-doc --> |
| 175 | * @generated |
| 176 | */ |
| 177 | @Override |
| 178 | public void eUnset(int featureID) { |
| 179 | switch (featureID) { |
| 180 | case QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY: |
| 181 | setQualityRepository((QualityRepository)null); |
| 182 | return; |
| 183 | } |
| 184 | super.eUnset(featureID); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * <!-- begin-user-doc --> |
| 189 | * <!-- end-user-doc --> |
| 190 | * @generated |
| 191 | */ |
| 192 | @Override |
| 193 | public boolean eIsSet(int featureID) { |
| 194 | switch (featureID) { |
| 195 | case QualityPackage.QUALITY_STATEMENT__QUALITY_REPOSITORY: |
| 196 | return getQualityRepository() != null; |
| 197 | } |
| 198 | return super.eIsSet(featureID); |
| 199 | } |
| 200 | |
| 201 | } //QualityStatementImpl |