| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.pcm.cost.impl; |
| 8 | |
| 9 | import de.uka.ipd.sdq.pcm.cost.FixedProcessingResourceCost; |
| 10 | import de.uka.ipd.sdq.pcm.cost.costPackage; |
| 11 | |
| 12 | import de.uka.ipd.sdq.pcm.resourceenvironment.ProcessingResourceSpecification; |
| 13 | |
| 14 | import org.eclipse.emf.common.notify.Notification; |
| 15 | |
| 16 | import org.eclipse.emf.ecore.EClass; |
| 17 | import org.eclipse.emf.ecore.EObject; |
| 18 | import org.eclipse.emf.ecore.InternalEObject; |
| 19 | |
| 20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 21 | |
| 22 | /** |
| 23 | * <!-- begin-user-doc --> |
| 24 | * An implementation of the model object '<em><b>Fixed Processing Resource Cost</b></em>'. |
| 25 | * <!-- end-user-doc --> |
| 26 | * <p> |
| 27 | * The following features are implemented: |
| 28 | * <ul> |
| 29 | * <li>{@link de.uka.ipd.sdq.pcm.cost.impl.FixedProcessingResourceCostImpl#getFixedOperatingCost <em>Fixed Operating Cost</em>}</li> |
| 30 | * <li>{@link de.uka.ipd.sdq.pcm.cost.impl.FixedProcessingResourceCostImpl#getFixedInitialCost <em>Fixed Initial Cost</em>}</li> |
| 31 | * </ul> |
| 32 | * </p> |
| 33 | * |
| 34 | * @generated |
| 35 | */ |
| 36 | public class FixedProcessingResourceCostImpl extends ProcessingResourceCostImpl implements FixedProcessingResourceCost { |
| 37 | /** |
| 38 | * The default value of the '{@link #getFixedOperatingCost() <em>Fixed Operating Cost</em>}' attribute. |
| 39 | * <!-- begin-user-doc --> |
| 40 | * <!-- end-user-doc --> |
| 41 | * @see #getFixedOperatingCost() |
| 42 | * @generated |
| 43 | * @ordered |
| 44 | */ |
| 45 | protected static final double FIXED_OPERATING_COST_EDEFAULT = 0.0; |
| 46 | /** |
| 47 | * The cached value of the '{@link #getFixedOperatingCost() <em>Fixed Operating Cost</em>}' attribute. |
| 48 | * <!-- begin-user-doc --> |
| 49 | * <!-- end-user-doc --> |
| 50 | * @see #getFixedOperatingCost() |
| 51 | * @generated |
| 52 | * @ordered |
| 53 | */ |
| 54 | protected double fixedOperatingCost = FIXED_OPERATING_COST_EDEFAULT; |
| 55 | /** |
| 56 | * The default value of the '{@link #getFixedInitialCost() <em>Fixed Initial Cost</em>}' attribute. |
| 57 | * <!-- begin-user-doc --> |
| 58 | * <!-- end-user-doc --> |
| 59 | * @see #getFixedInitialCost() |
| 60 | * @generated |
| 61 | * @ordered |
| 62 | */ |
| 63 | protected static final double FIXED_INITIAL_COST_EDEFAULT = 0.0; |
| 64 | /** |
| 65 | * The cached value of the '{@link #getFixedInitialCost() <em>Fixed Initial Cost</em>}' attribute. |
| 66 | * <!-- begin-user-doc --> |
| 67 | * <!-- end-user-doc --> |
| 68 | * @see #getFixedInitialCost() |
| 69 | * @generated |
| 70 | * @ordered |
| 71 | */ |
| 72 | protected double fixedInitialCost = FIXED_INITIAL_COST_EDEFAULT; |
| 73 | |
| 74 | /** |
| 75 | * <!-- begin-user-doc --> |
| 76 | * <!-- end-user-doc --> |
| 77 | * @generated |
| 78 | */ |
| 79 | protected FixedProcessingResourceCostImpl() { |
| 80 | super(); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * <!-- begin-user-doc --> |
| 85 | * <!-- end-user-doc --> |
| 86 | * @generated |
| 87 | */ |
| 88 | @Override |
| 89 | protected EClass eStaticClass() { |
| 90 | return costPackage.Literals.FIXED_PROCESSING_RESOURCE_COST; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * <!-- begin-user-doc --> |
| 95 | * <!-- end-user-doc --> |
| 96 | * @generated |
| 97 | */ |
| 98 | public double getFixedOperatingCost() { |
| 99 | return fixedOperatingCost; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * <!-- begin-user-doc --> |
| 104 | * <!-- end-user-doc --> |
| 105 | * @generated |
| 106 | */ |
| 107 | public void setFixedOperatingCost(double newFixedOperatingCost) { |
| 108 | double oldFixedOperatingCost = fixedOperatingCost; |
| 109 | fixedOperatingCost = newFixedOperatingCost; |
| 110 | if (eNotificationRequired()) |
| 111 | eNotify(new ENotificationImpl(this, Notification.SET, costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_OPERATING_COST, oldFixedOperatingCost, fixedOperatingCost)); |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * <!-- begin-user-doc --> |
| 116 | * <!-- end-user-doc --> |
| 117 | * @generated |
| 118 | */ |
| 119 | public double getFixedInitialCost() { |
| 120 | return fixedInitialCost; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * <!-- begin-user-doc --> |
| 125 | * <!-- end-user-doc --> |
| 126 | * @generated |
| 127 | */ |
| 128 | public void setFixedInitialCost(double newFixedInitialCost) { |
| 129 | double oldFixedInitialCost = fixedInitialCost; |
| 130 | fixedInitialCost = newFixedInitialCost; |
| 131 | if (eNotificationRequired()) |
| 132 | eNotify(new ENotificationImpl(this, Notification.SET, costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_INITIAL_COST, oldFixedInitialCost, fixedInitialCost)); |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * <!-- begin-user-doc --> |
| 137 | * <!-- end-user-doc --> |
| 138 | * @generated |
| 139 | */ |
| 140 | @Override |
| 141 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 142 | switch (featureID) { |
| 143 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_OPERATING_COST: |
| 144 | return getFixedOperatingCost(); |
| 145 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_INITIAL_COST: |
| 146 | return getFixedInitialCost(); |
| 147 | } |
| 148 | return super.eGet(featureID, resolve, coreType); |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * <!-- begin-user-doc --> |
| 153 | * <!-- end-user-doc --> |
| 154 | * @generated |
| 155 | */ |
| 156 | @Override |
| 157 | public void eSet(int featureID, Object newValue) { |
| 158 | switch (featureID) { |
| 159 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_OPERATING_COST: |
| 160 | setFixedOperatingCost((Double)newValue); |
| 161 | return; |
| 162 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_INITIAL_COST: |
| 163 | setFixedInitialCost((Double)newValue); |
| 164 | return; |
| 165 | } |
| 166 | super.eSet(featureID, newValue); |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * <!-- begin-user-doc --> |
| 171 | * <!-- end-user-doc --> |
| 172 | * @generated |
| 173 | */ |
| 174 | @Override |
| 175 | public void eUnset(int featureID) { |
| 176 | switch (featureID) { |
| 177 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_OPERATING_COST: |
| 178 | setFixedOperatingCost(FIXED_OPERATING_COST_EDEFAULT); |
| 179 | return; |
| 180 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_INITIAL_COST: |
| 181 | setFixedInitialCost(FIXED_INITIAL_COST_EDEFAULT); |
| 182 | return; |
| 183 | } |
| 184 | super.eUnset(featureID); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * <!-- begin-user-doc --> |
| 189 | * <!-- end-user-doc --> |
| 190 | * @generated |
| 191 | */ |
| 192 | @Override |
| 193 | public boolean eIsSet(int featureID) { |
| 194 | switch (featureID) { |
| 195 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_OPERATING_COST: |
| 196 | return fixedOperatingCost != FIXED_OPERATING_COST_EDEFAULT; |
| 197 | case costPackage.FIXED_PROCESSING_RESOURCE_COST__FIXED_INITIAL_COST: |
| 198 | return fixedInitialCost != FIXED_INITIAL_COST_EDEFAULT; |
| 199 | } |
| 200 | return super.eIsSet(featureID); |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * <!-- begin-user-doc --> |
| 205 | * <!-- end-user-doc --> |
| 206 | * @generated |
| 207 | */ |
| 208 | @Override |
| 209 | public String toString() { |
| 210 | if (eIsProxy()) return super.toString(); |
| 211 | |
| 212 | StringBuffer result = new StringBuffer(super.toString()); |
| 213 | result.append(" (fixedOperatingCost: "); |
| 214 | result.append(fixedOperatingCost); |
| 215 | result.append(", fixedInitialCost: "); |
| 216 | result.append(fixedInitialCost); |
| 217 | result.append(')'); |
| 218 | return result.toString(); |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * <!-- begin-user-doc --> |
| 223 | * <!-- end-user-doc --> |
| 224 | * @generated not |
| 225 | */ |
| 226 | @Override |
| 227 | public double getOperatingCost() { |
| 228 | return this.getFixedOperatingCost(); |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * <!-- begin-user-doc --> |
| 233 | * <!-- end-user-doc --> |
| 234 | * @generated not |
| 235 | */ |
| 236 | @Override |
| 237 | public double getInitialCost() { |
| 238 | return this.getFixedInitialCost(); |
| 239 | } |
| 240 | |
| 241 | @Override |
| 242 | public EObject basicGetAnnotatedElement() { |
| 243 | return this.getProcessingresourcespecification(); |
| 244 | } |
| 245 | |
| 246 | } //FixedProcessingResourceCostImpl |