| 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 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 17 | |
| 18 | import scheduler.configuration.ConfigurationPackage; |
| 19 | import scheduler.configuration.PriorityBoostConfiguration; |
| 20 | import scheduler.configuration.PriorityConfiguration; |
| 21 | import scheduler.configuration.PriorityRange; |
| 22 | |
| 23 | /** |
| 24 | * <!-- begin-user-doc --> |
| 25 | * An implementation of the model object '<em><b>Priority Configuration</b></em>'. |
| 26 | * <!-- end-user-doc --> |
| 27 | * <p> |
| 28 | * The following features are implemented: |
| 29 | * <ul> |
| 30 | * <li>{@link scheduler.configuration.impl.PriorityConfigurationImpl#getRange <em>Range</em>}</li> |
| 31 | * <li>{@link scheduler.configuration.impl.PriorityConfigurationImpl#getBoostConfiguration <em>Boost Configuration</em>}</li> |
| 32 | * </ul> |
| 33 | * </p> |
| 34 | * |
| 35 | * @generated |
| 36 | */ |
| 37 | public class PriorityConfigurationImpl extends EObjectImpl implements PriorityConfiguration { |
| 38 | /** |
| 39 | * The cached value of the '{@link #getRange() <em>Range</em>}' containment reference. |
| 40 | * <!-- begin-user-doc --> |
| 41 | * <!-- end-user-doc --> |
| 42 | * @see #getRange() |
| 43 | * @generated |
| 44 | * @ordered |
| 45 | */ |
| 46 | protected PriorityRange range; |
| 47 | |
| 48 | /** |
| 49 | * The cached value of the '{@link #getBoostConfiguration() <em>Boost Configuration</em>}' containment reference. |
| 50 | * <!-- begin-user-doc --> |
| 51 | * <!-- end-user-doc --> |
| 52 | * @see #getBoostConfiguration() |
| 53 | * @generated |
| 54 | * @ordered |
| 55 | */ |
| 56 | protected PriorityBoostConfiguration boostConfiguration; |
| 57 | |
| 58 | /** |
| 59 | * <!-- begin-user-doc --> |
| 60 | * <!-- end-user-doc --> |
| 61 | * @generated |
| 62 | */ |
| 63 | protected PriorityConfigurationImpl() { |
| 64 | super(); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * <!-- begin-user-doc --> |
| 69 | * <!-- end-user-doc --> |
| 70 | * @generated |
| 71 | */ |
| 72 | @Override |
| 73 | protected EClass eStaticClass() { |
| 74 | return ConfigurationPackage.Literals.PRIORITY_CONFIGURATION; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * <!-- begin-user-doc --> |
| 79 | * <!-- end-user-doc --> |
| 80 | * @generated |
| 81 | */ |
| 82 | public PriorityRange getRange() { |
| 83 | return range; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * <!-- begin-user-doc --> |
| 88 | * <!-- end-user-doc --> |
| 89 | * @generated |
| 90 | */ |
| 91 | public NotificationChain basicSetRange(PriorityRange newRange, NotificationChain msgs) { |
| 92 | PriorityRange oldRange = range; |
| 93 | range = newRange; |
| 94 | if (eNotificationRequired()) { |
| 95 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE, oldRange, newRange); |
| 96 | if (msgs == null) msgs = notification; else msgs.add(notification); |
| 97 | } |
| 98 | return msgs; |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * <!-- begin-user-doc --> |
| 103 | * <!-- end-user-doc --> |
| 104 | * @generated |
| 105 | */ |
| 106 | public void setRange(PriorityRange newRange) { |
| 107 | if (newRange != range) { |
| 108 | NotificationChain msgs = null; |
| 109 | if (range != null) |
| 110 | msgs = ((InternalEObject)range).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE, null, msgs); |
| 111 | if (newRange != null) |
| 112 | msgs = ((InternalEObject)newRange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE, null, msgs); |
| 113 | msgs = basicSetRange(newRange, msgs); |
| 114 | if (msgs != null) msgs.dispatch(); |
| 115 | } |
| 116 | else if (eNotificationRequired()) |
| 117 | eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE, newRange, newRange)); |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * <!-- begin-user-doc --> |
| 122 | * <!-- end-user-doc --> |
| 123 | * @generated |
| 124 | */ |
| 125 | public PriorityBoostConfiguration getBoostConfiguration() { |
| 126 | return boostConfiguration; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * <!-- begin-user-doc --> |
| 131 | * <!-- end-user-doc --> |
| 132 | * @generated |
| 133 | */ |
| 134 | public NotificationChain basicSetBoostConfiguration(PriorityBoostConfiguration newBoostConfiguration, NotificationChain msgs) { |
| 135 | PriorityBoostConfiguration oldBoostConfiguration = boostConfiguration; |
| 136 | boostConfiguration = newBoostConfiguration; |
| 137 | if (eNotificationRequired()) { |
| 138 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION, oldBoostConfiguration, newBoostConfiguration); |
| 139 | if (msgs == null) msgs = notification; else msgs.add(notification); |
| 140 | } |
| 141 | return msgs; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * <!-- begin-user-doc --> |
| 146 | * <!-- end-user-doc --> |
| 147 | * @generated |
| 148 | */ |
| 149 | public void setBoostConfiguration(PriorityBoostConfiguration newBoostConfiguration) { |
| 150 | if (newBoostConfiguration != boostConfiguration) { |
| 151 | NotificationChain msgs = null; |
| 152 | if (boostConfiguration != null) |
| 153 | msgs = ((InternalEObject)boostConfiguration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION, null, msgs); |
| 154 | if (newBoostConfiguration != null) |
| 155 | msgs = ((InternalEObject)newBoostConfiguration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION, null, msgs); |
| 156 | msgs = basicSetBoostConfiguration(newBoostConfiguration, msgs); |
| 157 | if (msgs != null) msgs.dispatch(); |
| 158 | } |
| 159 | else if (eNotificationRequired()) |
| 160 | eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION, newBoostConfiguration, newBoostConfiguration)); |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * <!-- begin-user-doc --> |
| 165 | * <!-- end-user-doc --> |
| 166 | * @generated |
| 167 | */ |
| 168 | @Override |
| 169 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 170 | switch (featureID) { |
| 171 | case ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE: |
| 172 | return basicSetRange(null, msgs); |
| 173 | case ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION: |
| 174 | return basicSetBoostConfiguration(null, msgs); |
| 175 | } |
| 176 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * <!-- begin-user-doc --> |
| 181 | * <!-- end-user-doc --> |
| 182 | * @generated |
| 183 | */ |
| 184 | @Override |
| 185 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 186 | switch (featureID) { |
| 187 | case ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE: |
| 188 | return getRange(); |
| 189 | case ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION: |
| 190 | return getBoostConfiguration(); |
| 191 | } |
| 192 | return super.eGet(featureID, resolve, coreType); |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * <!-- begin-user-doc --> |
| 197 | * <!-- end-user-doc --> |
| 198 | * @generated |
| 199 | */ |
| 200 | @Override |
| 201 | public void eSet(int featureID, Object newValue) { |
| 202 | switch (featureID) { |
| 203 | case ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE: |
| 204 | setRange((PriorityRange)newValue); |
| 205 | return; |
| 206 | case ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION: |
| 207 | setBoostConfiguration((PriorityBoostConfiguration)newValue); |
| 208 | return; |
| 209 | } |
| 210 | super.eSet(featureID, newValue); |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * <!-- begin-user-doc --> |
| 215 | * <!-- end-user-doc --> |
| 216 | * @generated |
| 217 | */ |
| 218 | @Override |
| 219 | public void eUnset(int featureID) { |
| 220 | switch (featureID) { |
| 221 | case ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE: |
| 222 | setRange((PriorityRange)null); |
| 223 | return; |
| 224 | case ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION: |
| 225 | setBoostConfiguration((PriorityBoostConfiguration)null); |
| 226 | return; |
| 227 | } |
| 228 | super.eUnset(featureID); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * <!-- begin-user-doc --> |
| 233 | * <!-- end-user-doc --> |
| 234 | * @generated |
| 235 | */ |
| 236 | @Override |
| 237 | public boolean eIsSet(int featureID) { |
| 238 | switch (featureID) { |
| 239 | case ConfigurationPackage.PRIORITY_CONFIGURATION__RANGE: |
| 240 | return range != null; |
| 241 | case ConfigurationPackage.PRIORITY_CONFIGURATION__BOOST_CONFIGURATION: |
| 242 | return boostConfiguration != null; |
| 243 | } |
| 244 | return super.eIsSet(featureID); |
| 245 | } |
| 246 | |
| 247 | } //PriorityConfigurationImpl |