| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.resourceenvironment.impl; |
| 7 | |
| 8 | import org.eclipse.emf.common.notify.Notification; |
| 9 | import org.eclipse.emf.common.notify.NotificationChain; |
| 10 | import org.eclipse.emf.ecore.EClass; |
| 11 | import org.eclipse.emf.ecore.InternalEObject; |
| 12 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 13 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 14 | import org.eclipse.emf.ecore.util.EcoreUtil; |
| 15 | |
| 16 | import de.uka.ipd.sdq.pcm.core.CorePackage; |
| 17 | import de.uka.ipd.sdq.pcm.core.PCMRandomVariable; |
| 18 | import de.uka.ipd.sdq.pcm.resourceenvironment.ProcessingResourceSpecification; |
| 19 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer; |
| 20 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceenvironmentPackage; |
| 21 | import de.uka.ipd.sdq.pcm.resourceenvironment.SchedulingPolicy; |
| 22 | import de.uka.ipd.sdq.pcm.resourcetype.ProcessingResourceType; |
| 23 | |
| 24 | /** |
| 25 | * <!-- begin-user-doc --> |
| 26 | * An implementation of the model object '<em><b>Processing Resource Specification</b></em>'. |
| 27 | * <!-- end-user-doc --> |
| 28 | * <p> |
| 29 | * The following features are implemented: |
| 30 | * <ul> |
| 31 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#getMTTR <em>MTTR</em>}</li> |
| 32 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#getMTTF <em>MTTF</em>}</li> |
| 33 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#isRequiredByContainer <em>Required By Container</em>}</li> |
| 34 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#getSchedulingPolicy <em>Scheduling Policy</em>}</li> |
| 35 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#getActiveResourceType_ActiveResourceSpecification <em>Active Resource Type Active Resource Specification</em>}</li> |
| 36 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#getProcessingRate_ProcessingResourceSpecification <em>Processing Rate Processing Resource Specification</em>}</li> |
| 37 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#getNumberOfReplicas <em>Number Of Replicas</em>}</li> |
| 38 | * <li>{@link de.uka.ipd.sdq.pcm.resourceenvironment.impl.ProcessingResourceSpecificationImpl#getResourceContainer_ProcessingResourceSpecification <em>Resource Container Processing Resource Specification</em>}</li> |
| 39 | * </ul> |
| 40 | * </p> |
| 41 | * |
| 42 | * @generated |
| 43 | */ |
| 44 | public class ProcessingResourceSpecificationImpl extends EObjectImpl implements ProcessingResourceSpecification { |
| 45 | /** |
| 46 | * <!-- begin-user-doc --> |
| 47 | * <!-- end-user-doc --> |
| 48 | * @generated |
| 49 | */ |
| 50 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 51 | |
| 52 | /** |
| 53 | * The default value of the '{@link #getMTTR() <em>MTTR</em>}' attribute. |
| 54 | * <!-- begin-user-doc --> |
| 55 | * <!-- end-user-doc --> |
| 56 | * @see #getMTTR() |
| 57 | * @generated |
| 58 | * @ordered |
| 59 | */ |
| 60 | protected static final double MTTR_EDEFAULT = 0.0; |
| 61 | |
| 62 | /** |
| 63 | * The cached value of the '{@link #getMTTR() <em>MTTR</em>}' attribute. |
| 64 | * <!-- begin-user-doc --> |
| 65 | * <!-- end-user-doc --> |
| 66 | * @see #getMTTR() |
| 67 | * @generated |
| 68 | * @ordered |
| 69 | */ |
| 70 | protected double mttr = MTTR_EDEFAULT; |
| 71 | |
| 72 | /** |
| 73 | * The default value of the '{@link #getMTTF() <em>MTTF</em>}' attribute. |
| 74 | * <!-- begin-user-doc --> |
| 75 | * <!-- end-user-doc --> |
| 76 | * @see #getMTTF() |
| 77 | * @generated |
| 78 | * @ordered |
| 79 | */ |
| 80 | protected static final double MTTF_EDEFAULT = 0.0; |
| 81 | |
| 82 | /** |
| 83 | * The cached value of the '{@link #getMTTF() <em>MTTF</em>}' attribute. |
| 84 | * <!-- begin-user-doc --> |
| 85 | * <!-- end-user-doc --> |
| 86 | * @see #getMTTF() |
| 87 | * @generated |
| 88 | * @ordered |
| 89 | */ |
| 90 | protected double mttf = MTTF_EDEFAULT; |
| 91 | |
| 92 | /** |
| 93 | * The default value of the '{@link #isRequiredByContainer() <em>Required By Container</em>}' attribute. |
| 94 | * <!-- begin-user-doc --> |
| 95 | * <!-- end-user-doc --> |
| 96 | * @see #isRequiredByContainer() |
| 97 | * @generated |
| 98 | * @ordered |
| 99 | */ |
| 100 | protected static final boolean REQUIRED_BY_CONTAINER_EDEFAULT = false; |
| 101 | |
| 102 | /** |
| 103 | * The cached value of the '{@link #isRequiredByContainer() <em>Required By Container</em>}' attribute. |
| 104 | * <!-- begin-user-doc --> |
| 105 | * <!-- end-user-doc --> |
| 106 | * @see #isRequiredByContainer() |
| 107 | * @generated |
| 108 | * @ordered |
| 109 | */ |
| 110 | protected boolean requiredByContainer = REQUIRED_BY_CONTAINER_EDEFAULT; |
| 111 | |
| 112 | /** |
| 113 | * The default value of the '{@link #getSchedulingPolicy() <em>Scheduling Policy</em>}' attribute. |
| 114 | * <!-- begin-user-doc --> |
| 115 | * <!-- end-user-doc --> |
| 116 | * @see #getSchedulingPolicy() |
| 117 | * @generated |
| 118 | * @ordered |
| 119 | */ |
| 120 | protected static final SchedulingPolicy SCHEDULING_POLICY_EDEFAULT = SchedulingPolicy.FCFS; |
| 121 | |
| 122 | /** |
| 123 | * The cached value of the '{@link #getSchedulingPolicy() <em>Scheduling Policy</em>}' attribute. |
| 124 | * <!-- begin-user-doc --> |
| 125 | * <!-- end-user-doc --> |
| 126 | * @see #getSchedulingPolicy() |
| 127 | * @generated |
| 128 | * @ordered |
| 129 | */ |
| 130 | protected SchedulingPolicy schedulingPolicy = SCHEDULING_POLICY_EDEFAULT; |
| 131 | |
| 132 | /** |
| 133 | * The cached value of the '{@link #getActiveResourceType_ActiveResourceSpecification() <em>Active Resource Type Active Resource Specification</em>}' reference. |
| 134 | * <!-- begin-user-doc --> |
| 135 | * <!-- end-user-doc --> |
| 136 | * @see #getActiveResourceType_ActiveResourceSpecification() |
| 137 | * @generated |
| 138 | * @ordered |
| 139 | */ |
| 140 | protected ProcessingResourceType activeResourceType_ActiveResourceSpecification; |
| 141 | |
| 142 | /** |
| 143 | * The cached value of the '{@link #getProcessingRate_ProcessingResourceSpecification() <em>Processing Rate Processing Resource Specification</em>}' containment reference. |
| 144 | * <!-- begin-user-doc --> |
| 145 | * <!-- end-user-doc --> |
| 146 | * @see #getProcessingRate_ProcessingResourceSpecification() |
| 147 | * @generated |
| 148 | * @ordered |
| 149 | */ |
| 150 | protected PCMRandomVariable processingRate_ProcessingResourceSpecification; |
| 151 | |
| 152 | /** |
| 153 | * The default value of the '{@link #getNumberOfReplicas() <em>Number Of Replicas</em>}' attribute. |
| 154 | * <!-- begin-user-doc --> |
| 155 | * <!-- end-user-doc --> |
| 156 | * @see #getNumberOfReplicas() |
| 157 | * @generated |
| 158 | * @ordered |
| 159 | */ |
| 160 | protected static final int NUMBER_OF_REPLICAS_EDEFAULT = 1; |
| 161 | |
| 162 | /** |
| 163 | * The cached value of the '{@link #getNumberOfReplicas() <em>Number Of Replicas</em>}' attribute. |
| 164 | * <!-- begin-user-doc --> |
| 165 | * <!-- end-user-doc --> |
| 166 | * @see #getNumberOfReplicas() |
| 167 | * @generated |
| 168 | * @ordered |
| 169 | */ |
| 170 | protected int numberOfReplicas = NUMBER_OF_REPLICAS_EDEFAULT; |
| 171 | |
| 172 | /** |
| 173 | * <!-- begin-user-doc --> |
| 174 | * <!-- end-user-doc --> |
| 175 | * @generated |
| 176 | */ |
| 177 | protected ProcessingResourceSpecificationImpl() { |
| 178 | super(); |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * <!-- begin-user-doc --> |
| 183 | * <!-- end-user-doc --> |
| 184 | * @generated |
| 185 | */ |
| 186 | @Override |
| 187 | protected EClass eStaticClass() { |
| 188 | return ResourceenvironmentPackage.Literals.PROCESSING_RESOURCE_SPECIFICATION; |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * <!-- begin-user-doc --> |
| 193 | * <!-- end-user-doc --> |
| 194 | * @generated |
| 195 | */ |
| 196 | public double getMTTR() { |
| 197 | return mttr; |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * <!-- begin-user-doc --> |
| 202 | * <!-- end-user-doc --> |
| 203 | * @generated |
| 204 | */ |
| 205 | public void setMTTR(double newMTTR) { |
| 206 | double oldMTTR = mttr; |
| 207 | mttr = newMTTR; |
| 208 | if (eNotificationRequired()) |
| 209 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTR, oldMTTR, mttr)); |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * <!-- begin-user-doc --> |
| 214 | * <!-- end-user-doc --> |
| 215 | * @generated |
| 216 | */ |
| 217 | public double getMTTF() { |
| 218 | return mttf; |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * <!-- begin-user-doc --> |
| 223 | * <!-- end-user-doc --> |
| 224 | * @generated |
| 225 | */ |
| 226 | public void setMTTF(double newMTTF) { |
| 227 | double oldMTTF = mttf; |
| 228 | mttf = newMTTF; |
| 229 | if (eNotificationRequired()) |
| 230 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTF, oldMTTF, mttf)); |
| 231 | } |
| 232 | |
| 233 | /** |
| 234 | * <!-- begin-user-doc --> |
| 235 | * <!-- end-user-doc --> |
| 236 | * @generated |
| 237 | */ |
| 238 | public boolean isRequiredByContainer() { |
| 239 | return requiredByContainer; |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * <!-- begin-user-doc --> |
| 244 | * <!-- end-user-doc --> |
| 245 | * @generated |
| 246 | */ |
| 247 | public void setRequiredByContainer(boolean newRequiredByContainer) { |
| 248 | boolean oldRequiredByContainer = requiredByContainer; |
| 249 | requiredByContainer = newRequiredByContainer; |
| 250 | if (eNotificationRequired()) |
| 251 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__REQUIRED_BY_CONTAINER, oldRequiredByContainer, requiredByContainer)); |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * <!-- begin-user-doc --> |
| 256 | * <!-- end-user-doc --> |
| 257 | * @generated |
| 258 | */ |
| 259 | public SchedulingPolicy getSchedulingPolicy() { |
| 260 | return schedulingPolicy; |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * <!-- begin-user-doc --> |
| 265 | * <!-- end-user-doc --> |
| 266 | * @generated |
| 267 | */ |
| 268 | public void setSchedulingPolicy(SchedulingPolicy newSchedulingPolicy) { |
| 269 | SchedulingPolicy oldSchedulingPolicy = schedulingPolicy; |
| 270 | schedulingPolicy = newSchedulingPolicy == null ? SCHEDULING_POLICY_EDEFAULT : newSchedulingPolicy; |
| 271 | if (eNotificationRequired()) |
| 272 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__SCHEDULING_POLICY, oldSchedulingPolicy, schedulingPolicy)); |
| 273 | } |
| 274 | |
| 275 | /** |
| 276 | * <!-- begin-user-doc --> |
| 277 | * <!-- end-user-doc --> |
| 278 | * @generated |
| 279 | */ |
| 280 | public ProcessingResourceType getActiveResourceType_ActiveResourceSpecification() { |
| 281 | if (activeResourceType_ActiveResourceSpecification != null && activeResourceType_ActiveResourceSpecification.eIsProxy()) { |
| 282 | InternalEObject oldActiveResourceType_ActiveResourceSpecification = (InternalEObject)activeResourceType_ActiveResourceSpecification; |
| 283 | activeResourceType_ActiveResourceSpecification = (ProcessingResourceType)eResolveProxy(oldActiveResourceType_ActiveResourceSpecification); |
| 284 | if (activeResourceType_ActiveResourceSpecification != oldActiveResourceType_ActiveResourceSpecification) { |
| 285 | if (eNotificationRequired()) |
| 286 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__ACTIVE_RESOURCE_TYPE_ACTIVE_RESOURCE_SPECIFICATION, oldActiveResourceType_ActiveResourceSpecification, activeResourceType_ActiveResourceSpecification)); |
| 287 | } |
| 288 | } |
| 289 | return activeResourceType_ActiveResourceSpecification; |
| 290 | } |
| 291 | |
| 292 | /** |
| 293 | * <!-- begin-user-doc --> |
| 294 | * <!-- end-user-doc --> |
| 295 | * @generated |
| 296 | */ |
| 297 | public ProcessingResourceType basicGetActiveResourceType_ActiveResourceSpecification() { |
| 298 | return activeResourceType_ActiveResourceSpecification; |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * <!-- begin-user-doc --> |
| 303 | * <!-- end-user-doc --> |
| 304 | * @generated |
| 305 | */ |
| 306 | public void setActiveResourceType_ActiveResourceSpecification(ProcessingResourceType newActiveResourceType_ActiveResourceSpecification) { |
| 307 | ProcessingResourceType oldActiveResourceType_ActiveResourceSpecification = activeResourceType_ActiveResourceSpecification; |
| 308 | activeResourceType_ActiveResourceSpecification = newActiveResourceType_ActiveResourceSpecification; |
| 309 | if (eNotificationRequired()) |
| 310 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__ACTIVE_RESOURCE_TYPE_ACTIVE_RESOURCE_SPECIFICATION, oldActiveResourceType_ActiveResourceSpecification, activeResourceType_ActiveResourceSpecification)); |
| 311 | } |
| 312 | |
| 313 | /** |
| 314 | * <!-- begin-user-doc --> |
| 315 | * <!-- end-user-doc --> |
| 316 | * @generated |
| 317 | */ |
| 318 | public PCMRandomVariable getProcessingRate_ProcessingResourceSpecification() { |
| 319 | return processingRate_ProcessingResourceSpecification; |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * <!-- begin-user-doc --> |
| 324 | * <!-- end-user-doc --> |
| 325 | * @generated |
| 326 | */ |
| 327 | public NotificationChain basicSetProcessingRate_ProcessingResourceSpecification(PCMRandomVariable newProcessingRate_ProcessingResourceSpecification, NotificationChain msgs) { |
| 328 | PCMRandomVariable oldProcessingRate_ProcessingResourceSpecification = processingRate_ProcessingResourceSpecification; |
| 329 | processingRate_ProcessingResourceSpecification = newProcessingRate_ProcessingResourceSpecification; |
| 330 | if (eNotificationRequired()) { |
| 331 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION, oldProcessingRate_ProcessingResourceSpecification, newProcessingRate_ProcessingResourceSpecification); |
| 332 | if (msgs == null) msgs = notification; else msgs.add(notification); |
| 333 | } |
| 334 | return msgs; |
| 335 | } |
| 336 | |
| 337 | /** |
| 338 | * <!-- begin-user-doc --> |
| 339 | * <!-- end-user-doc --> |
| 340 | * @generated |
| 341 | */ |
| 342 | public void setProcessingRate_ProcessingResourceSpecification(PCMRandomVariable newProcessingRate_ProcessingResourceSpecification) { |
| 343 | if (newProcessingRate_ProcessingResourceSpecification != processingRate_ProcessingResourceSpecification) { |
| 344 | NotificationChain msgs = null; |
| 345 | if (processingRate_ProcessingResourceSpecification != null) |
| 346 | msgs = ((InternalEObject)processingRate_ProcessingResourceSpecification).eInverseRemove(this, CorePackage.PCM_RANDOM_VARIABLE__PROCESSING_RESOURCE_SPECIFICATION_PROCESSING_RATE_PCM_RANDOM_VARIABLE, PCMRandomVariable.class, msgs); |
| 347 | if (newProcessingRate_ProcessingResourceSpecification != null) |
| 348 | msgs = ((InternalEObject)newProcessingRate_ProcessingResourceSpecification).eInverseAdd(this, CorePackage.PCM_RANDOM_VARIABLE__PROCESSING_RESOURCE_SPECIFICATION_PROCESSING_RATE_PCM_RANDOM_VARIABLE, PCMRandomVariable.class, msgs); |
| 349 | msgs = basicSetProcessingRate_ProcessingResourceSpecification(newProcessingRate_ProcessingResourceSpecification, msgs); |
| 350 | if (msgs != null) msgs.dispatch(); |
| 351 | } |
| 352 | else if (eNotificationRequired()) |
| 353 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION, newProcessingRate_ProcessingResourceSpecification, newProcessingRate_ProcessingResourceSpecification)); |
| 354 | } |
| 355 | |
| 356 | /** |
| 357 | * <!-- begin-user-doc --> |
| 358 | * <!-- end-user-doc --> |
| 359 | * @generated |
| 360 | */ |
| 361 | public int getNumberOfReplicas() { |
| 362 | return numberOfReplicas; |
| 363 | } |
| 364 | |
| 365 | /** |
| 366 | * <!-- begin-user-doc --> |
| 367 | * <!-- end-user-doc --> |
| 368 | * @generated |
| 369 | */ |
| 370 | public void setNumberOfReplicas(int newNumberOfReplicas) { |
| 371 | int oldNumberOfReplicas = numberOfReplicas; |
| 372 | numberOfReplicas = newNumberOfReplicas; |
| 373 | if (eNotificationRequired()) |
| 374 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__NUMBER_OF_REPLICAS, oldNumberOfReplicas, numberOfReplicas)); |
| 375 | } |
| 376 | |
| 377 | /** |
| 378 | * <!-- begin-user-doc --> |
| 379 | * <!-- end-user-doc --> |
| 380 | * @generated |
| 381 | */ |
| 382 | public ResourceContainer getResourceContainer_ProcessingResourceSpecification() { |
| 383 | if (eContainerFeatureID() != ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION) return null; |
| 384 | return (ResourceContainer)eContainer(); |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * <!-- begin-user-doc --> |
| 389 | * <!-- end-user-doc --> |
| 390 | * @generated |
| 391 | */ |
| 392 | public NotificationChain basicSetResourceContainer_ProcessingResourceSpecification(ResourceContainer newResourceContainer_ProcessingResourceSpecification, NotificationChain msgs) { |
| 393 | msgs = eBasicSetContainer((InternalEObject)newResourceContainer_ProcessingResourceSpecification, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION, msgs); |
| 394 | return msgs; |
| 395 | } |
| 396 | |
| 397 | /** |
| 398 | * <!-- begin-user-doc --> |
| 399 | * <!-- end-user-doc --> |
| 400 | * @generated |
| 401 | */ |
| 402 | public void setResourceContainer_ProcessingResourceSpecification(ResourceContainer newResourceContainer_ProcessingResourceSpecification) { |
| 403 | if (newResourceContainer_ProcessingResourceSpecification != eInternalContainer() || (eContainerFeatureID() != ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION && newResourceContainer_ProcessingResourceSpecification != null)) { |
| 404 | if (EcoreUtil.isAncestor(this, newResourceContainer_ProcessingResourceSpecification)) |
| 405 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
| 406 | NotificationChain msgs = null; |
| 407 | if (eInternalContainer() != null) |
| 408 | msgs = eBasicRemoveFromContainer(msgs); |
| 409 | if (newResourceContainer_ProcessingResourceSpecification != null) |
| 410 | msgs = ((InternalEObject)newResourceContainer_ProcessingResourceSpecification).eInverseAdd(this, ResourceenvironmentPackage.RESOURCE_CONTAINER__ACTIVE_RESOURCE_SPECIFICATIONS_RESOURCE_CONTAINER, ResourceContainer.class, msgs); |
| 411 | msgs = basicSetResourceContainer_ProcessingResourceSpecification(newResourceContainer_ProcessingResourceSpecification, msgs); |
| 412 | if (msgs != null) msgs.dispatch(); |
| 413 | } |
| 414 | else if (eNotificationRequired()) |
| 415 | eNotify(new ENotificationImpl(this, Notification.SET, ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION, newResourceContainer_ProcessingResourceSpecification, newResourceContainer_ProcessingResourceSpecification)); |
| 416 | } |
| 417 | |
| 418 | /** |
| 419 | * <!-- begin-user-doc --> |
| 420 | * <!-- end-user-doc --> |
| 421 | * @generated |
| 422 | */ |
| 423 | @Override |
| 424 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 425 | switch (featureID) { |
| 426 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION: |
| 427 | if (processingRate_ProcessingResourceSpecification != null) |
| 428 | msgs = ((InternalEObject)processingRate_ProcessingResourceSpecification).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION, null, msgs); |
| 429 | return basicSetProcessingRate_ProcessingResourceSpecification((PCMRandomVariable)otherEnd, msgs); |
| 430 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION: |
| 431 | if (eInternalContainer() != null) |
| 432 | msgs = eBasicRemoveFromContainer(msgs); |
| 433 | return basicSetResourceContainer_ProcessingResourceSpecification((ResourceContainer)otherEnd, msgs); |
| 434 | } |
| 435 | return super.eInverseAdd(otherEnd, featureID, msgs); |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * <!-- begin-user-doc --> |
| 440 | * <!-- end-user-doc --> |
| 441 | * @generated |
| 442 | */ |
| 443 | @Override |
| 444 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 445 | switch (featureID) { |
| 446 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION: |
| 447 | return basicSetProcessingRate_ProcessingResourceSpecification(null, msgs); |
| 448 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION: |
| 449 | return basicSetResourceContainer_ProcessingResourceSpecification(null, msgs); |
| 450 | } |
| 451 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 452 | } |
| 453 | |
| 454 | /** |
| 455 | * <!-- begin-user-doc --> |
| 456 | * <!-- end-user-doc --> |
| 457 | * @generated |
| 458 | */ |
| 459 | @Override |
| 460 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
| 461 | switch (eContainerFeatureID()) { |
| 462 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION: |
| 463 | return eInternalContainer().eInverseRemove(this, ResourceenvironmentPackage.RESOURCE_CONTAINER__ACTIVE_RESOURCE_SPECIFICATIONS_RESOURCE_CONTAINER, ResourceContainer.class, msgs); |
| 464 | } |
| 465 | return super.eBasicRemoveFromContainerFeature(msgs); |
| 466 | } |
| 467 | |
| 468 | /** |
| 469 | * <!-- begin-user-doc --> |
| 470 | * <!-- end-user-doc --> |
| 471 | * @generated |
| 472 | */ |
| 473 | @Override |
| 474 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 475 | switch (featureID) { |
| 476 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTR: |
| 477 | return getMTTR(); |
| 478 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTF: |
| 479 | return getMTTF(); |
| 480 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__REQUIRED_BY_CONTAINER: |
| 481 | return isRequiredByContainer(); |
| 482 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__SCHEDULING_POLICY: |
| 483 | return getSchedulingPolicy(); |
| 484 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__ACTIVE_RESOURCE_TYPE_ACTIVE_RESOURCE_SPECIFICATION: |
| 485 | if (resolve) return getActiveResourceType_ActiveResourceSpecification(); |
| 486 | return basicGetActiveResourceType_ActiveResourceSpecification(); |
| 487 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION: |
| 488 | return getProcessingRate_ProcessingResourceSpecification(); |
| 489 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__NUMBER_OF_REPLICAS: |
| 490 | return getNumberOfReplicas(); |
| 491 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION: |
| 492 | return getResourceContainer_ProcessingResourceSpecification(); |
| 493 | } |
| 494 | return super.eGet(featureID, resolve, coreType); |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * <!-- begin-user-doc --> |
| 499 | * <!-- end-user-doc --> |
| 500 | * @generated |
| 501 | */ |
| 502 | @Override |
| 503 | public void eSet(int featureID, Object newValue) { |
| 504 | switch (featureID) { |
| 505 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTR: |
| 506 | setMTTR((Double)newValue); |
| 507 | return; |
| 508 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTF: |
| 509 | setMTTF((Double)newValue); |
| 510 | return; |
| 511 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__REQUIRED_BY_CONTAINER: |
| 512 | setRequiredByContainer((Boolean)newValue); |
| 513 | return; |
| 514 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__SCHEDULING_POLICY: |
| 515 | setSchedulingPolicy((SchedulingPolicy)newValue); |
| 516 | return; |
| 517 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__ACTIVE_RESOURCE_TYPE_ACTIVE_RESOURCE_SPECIFICATION: |
| 518 | setActiveResourceType_ActiveResourceSpecification((ProcessingResourceType)newValue); |
| 519 | return; |
| 520 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION: |
| 521 | setProcessingRate_ProcessingResourceSpecification((PCMRandomVariable)newValue); |
| 522 | return; |
| 523 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__NUMBER_OF_REPLICAS: |
| 524 | setNumberOfReplicas((Integer)newValue); |
| 525 | return; |
| 526 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION: |
| 527 | setResourceContainer_ProcessingResourceSpecification((ResourceContainer)newValue); |
| 528 | return; |
| 529 | } |
| 530 | super.eSet(featureID, newValue); |
| 531 | } |
| 532 | |
| 533 | /** |
| 534 | * <!-- begin-user-doc --> |
| 535 | * <!-- end-user-doc --> |
| 536 | * @generated |
| 537 | */ |
| 538 | @Override |
| 539 | public void eUnset(int featureID) { |
| 540 | switch (featureID) { |
| 541 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTR: |
| 542 | setMTTR(MTTR_EDEFAULT); |
| 543 | return; |
| 544 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTF: |
| 545 | setMTTF(MTTF_EDEFAULT); |
| 546 | return; |
| 547 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__REQUIRED_BY_CONTAINER: |
| 548 | setRequiredByContainer(REQUIRED_BY_CONTAINER_EDEFAULT); |
| 549 | return; |
| 550 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__SCHEDULING_POLICY: |
| 551 | setSchedulingPolicy(SCHEDULING_POLICY_EDEFAULT); |
| 552 | return; |
| 553 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__ACTIVE_RESOURCE_TYPE_ACTIVE_RESOURCE_SPECIFICATION: |
| 554 | setActiveResourceType_ActiveResourceSpecification((ProcessingResourceType)null); |
| 555 | return; |
| 556 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION: |
| 557 | setProcessingRate_ProcessingResourceSpecification((PCMRandomVariable)null); |
| 558 | return; |
| 559 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__NUMBER_OF_REPLICAS: |
| 560 | setNumberOfReplicas(NUMBER_OF_REPLICAS_EDEFAULT); |
| 561 | return; |
| 562 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION: |
| 563 | setResourceContainer_ProcessingResourceSpecification((ResourceContainer)null); |
| 564 | return; |
| 565 | } |
| 566 | super.eUnset(featureID); |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * <!-- begin-user-doc --> |
| 571 | * <!-- end-user-doc --> |
| 572 | * @generated |
| 573 | */ |
| 574 | @Override |
| 575 | public boolean eIsSet(int featureID) { |
| 576 | switch (featureID) { |
| 577 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTR: |
| 578 | return mttr != MTTR_EDEFAULT; |
| 579 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__MTTF: |
| 580 | return mttf != MTTF_EDEFAULT; |
| 581 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__REQUIRED_BY_CONTAINER: |
| 582 | return requiredByContainer != REQUIRED_BY_CONTAINER_EDEFAULT; |
| 583 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__SCHEDULING_POLICY: |
| 584 | return schedulingPolicy != SCHEDULING_POLICY_EDEFAULT; |
| 585 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__ACTIVE_RESOURCE_TYPE_ACTIVE_RESOURCE_SPECIFICATION: |
| 586 | return activeResourceType_ActiveResourceSpecification != null; |
| 587 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__PROCESSING_RATE_PROCESSING_RESOURCE_SPECIFICATION: |
| 588 | return processingRate_ProcessingResourceSpecification != null; |
| 589 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__NUMBER_OF_REPLICAS: |
| 590 | return numberOfReplicas != NUMBER_OF_REPLICAS_EDEFAULT; |
| 591 | case ResourceenvironmentPackage.PROCESSING_RESOURCE_SPECIFICATION__RESOURCE_CONTAINER_PROCESSING_RESOURCE_SPECIFICATION: |
| 592 | return getResourceContainer_ProcessingResourceSpecification() != null; |
| 593 | } |
| 594 | return super.eIsSet(featureID); |
| 595 | } |
| 596 | |
| 597 | /** |
| 598 | * <!-- begin-user-doc --> |
| 599 | * <!-- end-user-doc --> |
| 600 | * @generated |
| 601 | */ |
| 602 | @Override |
| 603 | public String toString() { |
| 604 | if (eIsProxy()) return super.toString(); |
| 605 | |
| 606 | StringBuffer result = new StringBuffer(super.toString()); |
| 607 | result.append(" (MTTR: "); |
| 608 | result.append(mttr); |
| 609 | result.append(", MTTF: "); |
| 610 | result.append(mttf); |
| 611 | result.append(", requiredByContainer: "); |
| 612 | result.append(requiredByContainer); |
| 613 | result.append(", schedulingPolicy: "); |
| 614 | result.append(schedulingPolicy); |
| 615 | result.append(", numberOfReplicas: "); |
| 616 | result.append(numberOfReplicas); |
| 617 | result.append(')'); |
| 618 | return result.toString(); |
| 619 | } |
| 620 | |
| 621 | } //ProcessingResourceSpecificationImpl |