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