| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package scheduler.configuration.impl; |
| 8 | |
| 9 | import org.eclipse.emf.common.notify.Notification; |
| 10 | |
| 11 | import org.eclipse.emf.ecore.EClass; |
| 12 | |
| 13 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 14 | |
| 15 | import scheduler.configuration.ConfigurationPackage; |
| 16 | import scheduler.configuration.DynamicPriorityBoostConfiguratioin; |
| 17 | |
| 18 | /** |
| 19 | * <!-- begin-user-doc --> |
| 20 | * An implementation of the model object '<em><b>Dynamic Priority Boost Configuratioin</b></em>'. |
| 21 | * <!-- end-user-doc --> |
| 22 | * <p> |
| 23 | * The following features are implemented: |
| 24 | * <ul> |
| 25 | * <li>{@link scheduler.configuration.impl.DynamicPriorityBoostConfiguratioinImpl#getMaxBonus <em>Max Bonus</em>}</li> |
| 26 | * <li>{@link scheduler.configuration.impl.DynamicPriorityBoostConfiguratioinImpl#getThreshold <em>Threshold</em>}</li> |
| 27 | * <li>{@link scheduler.configuration.impl.DynamicPriorityBoostConfiguratioinImpl#getMaxSleepAverage <em>Max Sleep Average</em>}</li> |
| 28 | * </ul> |
| 29 | * </p> |
| 30 | * |
| 31 | * @generated |
| 32 | */ |
| 33 | public class DynamicPriorityBoostConfiguratioinImpl extends PriorityBoostConfigurationImpl implements DynamicPriorityBoostConfiguratioin { |
| 34 | /** |
| 35 | * The default value of the '{@link #getMaxBonus() <em>Max Bonus</em>}' attribute. |
| 36 | * <!-- begin-user-doc --> |
| 37 | * <!-- end-user-doc --> |
| 38 | * @see #getMaxBonus() |
| 39 | * @generated |
| 40 | * @ordered |
| 41 | */ |
| 42 | protected static final int MAX_BONUS_EDEFAULT = 0; |
| 43 | |
| 44 | /** |
| 45 | * The cached value of the '{@link #getMaxBonus() <em>Max Bonus</em>}' attribute. |
| 46 | * <!-- begin-user-doc --> |
| 47 | * <!-- end-user-doc --> |
| 48 | * @see #getMaxBonus() |
| 49 | * @generated |
| 50 | * @ordered |
| 51 | */ |
| 52 | protected int maxBonus = MAX_BONUS_EDEFAULT; |
| 53 | |
| 54 | /** |
| 55 | * The default value of the '{@link #getThreshold() <em>Threshold</em>}' attribute. |
| 56 | * <!-- begin-user-doc --> |
| 57 | * <!-- end-user-doc --> |
| 58 | * @see #getThreshold() |
| 59 | * @generated |
| 60 | * @ordered |
| 61 | */ |
| 62 | protected static final int THRESHOLD_EDEFAULT = 0; |
| 63 | |
| 64 | /** |
| 65 | * The cached value of the '{@link #getThreshold() <em>Threshold</em>}' attribute. |
| 66 | * <!-- begin-user-doc --> |
| 67 | * <!-- end-user-doc --> |
| 68 | * @see #getThreshold() |
| 69 | * @generated |
| 70 | * @ordered |
| 71 | */ |
| 72 | protected int threshold = THRESHOLD_EDEFAULT; |
| 73 | |
| 74 | /** |
| 75 | * The default value of the '{@link #getMaxSleepAverage() <em>Max Sleep Average</em>}' attribute. |
| 76 | * <!-- begin-user-doc --> |
| 77 | * <!-- end-user-doc --> |
| 78 | * @see #getMaxSleepAverage() |
| 79 | * @generated |
| 80 | * @ordered |
| 81 | */ |
| 82 | protected static final double MAX_SLEEP_AVERAGE_EDEFAULT = 0.0; |
| 83 | |
| 84 | /** |
| 85 | * The cached value of the '{@link #getMaxSleepAverage() <em>Max Sleep Average</em>}' attribute. |
| 86 | * <!-- begin-user-doc --> |
| 87 | * <!-- end-user-doc --> |
| 88 | * @see #getMaxSleepAverage() |
| 89 | * @generated |
| 90 | * @ordered |
| 91 | */ |
| 92 | protected double maxSleepAverage = MAX_SLEEP_AVERAGE_EDEFAULT; |
| 93 | |
| 94 | /** |
| 95 | * <!-- begin-user-doc --> |
| 96 | * <!-- end-user-doc --> |
| 97 | * @generated |
| 98 | */ |
| 99 | protected DynamicPriorityBoostConfiguratioinImpl() { |
| 100 | super(); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * <!-- begin-user-doc --> |
| 105 | * <!-- end-user-doc --> |
| 106 | * @generated |
| 107 | */ |
| 108 | @Override |
| 109 | protected EClass eStaticClass() { |
| 110 | return ConfigurationPackage.Literals.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * <!-- begin-user-doc --> |
| 115 | * <!-- end-user-doc --> |
| 116 | * @generated |
| 117 | */ |
| 118 | public int getMaxBonus() { |
| 119 | return maxBonus; |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * <!-- begin-user-doc --> |
| 124 | * <!-- end-user-doc --> |
| 125 | * @generated |
| 126 | */ |
| 127 | public void setMaxBonus(int newMaxBonus) { |
| 128 | int oldMaxBonus = maxBonus; |
| 129 | maxBonus = newMaxBonus; |
| 130 | if (eNotificationRequired()) |
| 131 | eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_BONUS, oldMaxBonus, maxBonus)); |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * <!-- begin-user-doc --> |
| 136 | * <!-- end-user-doc --> |
| 137 | * @generated |
| 138 | */ |
| 139 | public int getThreshold() { |
| 140 | return threshold; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * <!-- begin-user-doc --> |
| 145 | * <!-- end-user-doc --> |
| 146 | * @generated |
| 147 | */ |
| 148 | public void setThreshold(int newThreshold) { |
| 149 | int oldThreshold = threshold; |
| 150 | threshold = newThreshold; |
| 151 | if (eNotificationRequired()) |
| 152 | eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__THRESHOLD, oldThreshold, threshold)); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * <!-- begin-user-doc --> |
| 157 | * <!-- end-user-doc --> |
| 158 | * @generated |
| 159 | */ |
| 160 | public double getMaxSleepAverage() { |
| 161 | return maxSleepAverage; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * <!-- begin-user-doc --> |
| 166 | * <!-- end-user-doc --> |
| 167 | * @generated |
| 168 | */ |
| 169 | public void setMaxSleepAverage(double newMaxSleepAverage) { |
| 170 | double oldMaxSleepAverage = maxSleepAverage; |
| 171 | maxSleepAverage = newMaxSleepAverage; |
| 172 | if (eNotificationRequired()) |
| 173 | eNotify(new ENotificationImpl(this, Notification.SET, ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_SLEEP_AVERAGE, oldMaxSleepAverage, maxSleepAverage)); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * <!-- begin-user-doc --> |
| 178 | * <!-- end-user-doc --> |
| 179 | * @generated |
| 180 | */ |
| 181 | @Override |
| 182 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 183 | switch (featureID) { |
| 184 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_BONUS: |
| 185 | return getMaxBonus(); |
| 186 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__THRESHOLD: |
| 187 | return getThreshold(); |
| 188 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_SLEEP_AVERAGE: |
| 189 | return getMaxSleepAverage(); |
| 190 | } |
| 191 | return super.eGet(featureID, resolve, coreType); |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * <!-- begin-user-doc --> |
| 196 | * <!-- end-user-doc --> |
| 197 | * @generated |
| 198 | */ |
| 199 | @Override |
| 200 | public void eSet(int featureID, Object newValue) { |
| 201 | switch (featureID) { |
| 202 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_BONUS: |
| 203 | setMaxBonus((Integer)newValue); |
| 204 | return; |
| 205 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__THRESHOLD: |
| 206 | setThreshold((Integer)newValue); |
| 207 | return; |
| 208 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_SLEEP_AVERAGE: |
| 209 | setMaxSleepAverage((Double)newValue); |
| 210 | return; |
| 211 | } |
| 212 | super.eSet(featureID, newValue); |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * <!-- begin-user-doc --> |
| 217 | * <!-- end-user-doc --> |
| 218 | * @generated |
| 219 | */ |
| 220 | @Override |
| 221 | public void eUnset(int featureID) { |
| 222 | switch (featureID) { |
| 223 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_BONUS: |
| 224 | setMaxBonus(MAX_BONUS_EDEFAULT); |
| 225 | return; |
| 226 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__THRESHOLD: |
| 227 | setThreshold(THRESHOLD_EDEFAULT); |
| 228 | return; |
| 229 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_SLEEP_AVERAGE: |
| 230 | setMaxSleepAverage(MAX_SLEEP_AVERAGE_EDEFAULT); |
| 231 | return; |
| 232 | } |
| 233 | super.eUnset(featureID); |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * <!-- begin-user-doc --> |
| 238 | * <!-- end-user-doc --> |
| 239 | * @generated |
| 240 | */ |
| 241 | @Override |
| 242 | public boolean eIsSet(int featureID) { |
| 243 | switch (featureID) { |
| 244 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_BONUS: |
| 245 | return maxBonus != MAX_BONUS_EDEFAULT; |
| 246 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__THRESHOLD: |
| 247 | return threshold != THRESHOLD_EDEFAULT; |
| 248 | case ConfigurationPackage.DYNAMIC_PRIORITY_BOOST_CONFIGURATIOIN__MAX_SLEEP_AVERAGE: |
| 249 | return maxSleepAverage != MAX_SLEEP_AVERAGE_EDEFAULT; |
| 250 | } |
| 251 | return super.eIsSet(featureID); |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * <!-- begin-user-doc --> |
| 256 | * <!-- end-user-doc --> |
| 257 | * @generated |
| 258 | */ |
| 259 | @Override |
| 260 | public String toString() { |
| 261 | if (eIsProxy()) return super.toString(); |
| 262 | |
| 263 | StringBuffer result = new StringBuffer(super.toString()); |
| 264 | result.append(" (maxBonus: "); |
| 265 | result.append(maxBonus); |
| 266 | result.append(", threshold: "); |
| 267 | result.append(threshold); |
| 268 | result.append(", maxSleepAverage: "); |
| 269 | result.append(maxSleepAverage); |
| 270 | result.append(')'); |
| 271 | return result.toString(); |
| 272 | } |
| 273 | |
| 274 | } //DynamicPriorityBoostConfiguratioinImpl |