| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.pcm.designdecision.impl; |
| 8 | |
| 9 | import de.uka.ipd.sdq.pcm.designdecision.ExchangeComponentRule; |
| 10 | import de.uka.ipd.sdq.pcm.designdecision.ResourceContainerReplicationDegreeWithComponentChange; |
| 11 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
| 12 | |
| 13 | import de.uka.ipd.sdq.pcm.repository.RepositoryComponent; |
| 14 | |
| 15 | import java.util.Collection; |
| 16 | |
| 17 | import org.eclipse.emf.common.notify.NotificationChain; |
| 18 | import org.eclipse.emf.common.util.EList; |
| 19 | |
| 20 | import org.eclipse.emf.ecore.EClass; |
| 21 | |
| 22 | import org.eclipse.emf.ecore.InternalEObject; |
| 23 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| 24 | import org.eclipse.emf.ecore.util.InternalEList; |
| 25 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| 26 | |
| 27 | /** |
| 28 | * <!-- begin-user-doc --> |
| 29 | * An implementation of the model object '<em><b>Resource Container Replication Degree With Component Change</b></em>'. |
| 30 | * <!-- end-user-doc --> |
| 31 | * <p> |
| 32 | * The following features are implemented: |
| 33 | * <ul> |
| 34 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.impl.ResourceContainerReplicationDegreeWithComponentChangeImpl#getExchangeComponentRule <em>Exchange Component Rule</em>}</li> |
| 35 | * </ul> |
| 36 | * </p> |
| 37 | * |
| 38 | * @generated |
| 39 | */ |
| 40 | public class ResourceContainerReplicationDegreeWithComponentChangeImpl extends ResourceContainerReplicationDegreeImpl implements ResourceContainerReplicationDegreeWithComponentChange { |
| 41 | /** |
| 42 | * The cached value of the '{@link #getExchangeComponentRule() <em>Exchange Component Rule</em>}' containment reference list. |
| 43 | * <!-- begin-user-doc --> |
| 44 | * <!-- end-user-doc --> |
| 45 | * @see #getExchangeComponentRule() |
| 46 | * @generated |
| 47 | * @ordered |
| 48 | */ |
| 49 | protected EList<ExchangeComponentRule> exchangeComponentRule; |
| 50 | /** |
| 51 | * <!-- begin-user-doc --> |
| 52 | * <!-- end-user-doc --> |
| 53 | * @generated |
| 54 | */ |
| 55 | protected ResourceContainerReplicationDegreeWithComponentChangeImpl() { |
| 56 | super(); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * <!-- begin-user-doc --> |
| 61 | * <!-- end-user-doc --> |
| 62 | * @generated |
| 63 | */ |
| 64 | @Override |
| 65 | protected EClass eStaticClass() { |
| 66 | return designdecisionPackage.Literals.RESOURCE_CONTAINER_REPLICATION_DEGREE_WITH_COMPONENT_CHANGE; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * <!-- begin-user-doc --> |
| 71 | * <!-- end-user-doc --> |
| 72 | * @generated |
| 73 | */ |
| 74 | public EList<ExchangeComponentRule> getExchangeComponentRule() { |
| 75 | if (exchangeComponentRule == null) { |
| 76 | exchangeComponentRule = new EObjectContainmentEList<ExchangeComponentRule>(ExchangeComponentRule.class, this, designdecisionPackage.RESOURCE_CONTAINER_REPLICATION_DEGREE_WITH_COMPONENT_CHANGE__EXCHANGE_COMPONENT_RULE); |
| 77 | } |
| 78 | return exchangeComponentRule; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * <!-- begin-user-doc --> |
| 83 | * <!-- end-user-doc --> |
| 84 | * @generated |
| 85 | */ |
| 86 | @Override |
| 87 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 88 | switch (featureID) { |
| 89 | case designdecisionPackage.RESOURCE_CONTAINER_REPLICATION_DEGREE_WITH_COMPONENT_CHANGE__EXCHANGE_COMPONENT_RULE: |
| 90 | return ((InternalEList<?>)getExchangeComponentRule()).basicRemove(otherEnd, msgs); |
| 91 | } |
| 92 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * <!-- begin-user-doc --> |
| 97 | * <!-- end-user-doc --> |
| 98 | * @generated |
| 99 | */ |
| 100 | @Override |
| 101 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 102 | switch (featureID) { |
| 103 | case designdecisionPackage.RESOURCE_CONTAINER_REPLICATION_DEGREE_WITH_COMPONENT_CHANGE__EXCHANGE_COMPONENT_RULE: |
| 104 | return getExchangeComponentRule(); |
| 105 | } |
| 106 | return super.eGet(featureID, resolve, coreType); |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * <!-- begin-user-doc --> |
| 111 | * <!-- end-user-doc --> |
| 112 | * @generated |
| 113 | */ |
| 114 | @SuppressWarnings("unchecked") |
| 115 | @Override |
| 116 | public void eSet(int featureID, Object newValue) { |
| 117 | switch (featureID) { |
| 118 | case designdecisionPackage.RESOURCE_CONTAINER_REPLICATION_DEGREE_WITH_COMPONENT_CHANGE__EXCHANGE_COMPONENT_RULE: |
| 119 | getExchangeComponentRule().clear(); |
| 120 | getExchangeComponentRule().addAll((Collection<? extends ExchangeComponentRule>)newValue); |
| 121 | return; |
| 122 | } |
| 123 | super.eSet(featureID, newValue); |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * <!-- begin-user-doc --> |
| 128 | * <!-- end-user-doc --> |
| 129 | * @generated |
| 130 | */ |
| 131 | @Override |
| 132 | public void eUnset(int featureID) { |
| 133 | switch (featureID) { |
| 134 | case designdecisionPackage.RESOURCE_CONTAINER_REPLICATION_DEGREE_WITH_COMPONENT_CHANGE__EXCHANGE_COMPONENT_RULE: |
| 135 | getExchangeComponentRule().clear(); |
| 136 | return; |
| 137 | } |
| 138 | super.eUnset(featureID); |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * <!-- begin-user-doc --> |
| 143 | * <!-- end-user-doc --> |
| 144 | * @generated |
| 145 | */ |
| 146 | @Override |
| 147 | public boolean eIsSet(int featureID) { |
| 148 | switch (featureID) { |
| 149 | case designdecisionPackage.RESOURCE_CONTAINER_REPLICATION_DEGREE_WITH_COMPONENT_CHANGE__EXCHANGE_COMPONENT_RULE: |
| 150 | return exchangeComponentRule != null && !exchangeComponentRule.isEmpty(); |
| 151 | } |
| 152 | return super.eIsSet(featureID); |
| 153 | } |
| 154 | |
| 155 | } //ResourceContainerReplicationDegreeWithComponentChangeImpl |