| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.pcm.designdecision.impl; |
| 8 | |
| 9 | import de.uka.ipd.sdq.pcm.designdecision.ContinousRangeChoice; |
| 10 | import de.uka.ipd.sdq.pcm.designdecision.designdecisionPackage; |
| 11 | |
| 12 | import org.eclipse.emf.common.notify.Notification; |
| 13 | |
| 14 | import org.eclipse.emf.ecore.EClass; |
| 15 | |
| 16 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 17 | |
| 18 | /** |
| 19 | * <!-- begin-user-doc --> |
| 20 | * An implementation of the model object '<em><b>Continous Range Choice</b></em>'. |
| 21 | * <!-- end-user-doc --> |
| 22 | * <p> |
| 23 | * The following features are implemented: |
| 24 | * <ul> |
| 25 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.impl.ContinousRangeChoiceImpl#getChosenValue <em>Chosen Value</em>}</li> |
| 26 | * </ul> |
| 27 | * </p> |
| 28 | * |
| 29 | * @generated |
| 30 | */ |
| 31 | public class ContinousRangeChoiceImpl extends ChoiceImpl implements ContinousRangeChoice { |
| 32 | /** |
| 33 | * The default value of the '{@link #getChosenValue() <em>Chosen Value</em>}' attribute. |
| 34 | * <!-- begin-user-doc --> |
| 35 | * <!-- end-user-doc --> |
| 36 | * @see #getChosenValue() |
| 37 | * @generated |
| 38 | * @ordered |
| 39 | */ |
| 40 | protected static final double CHOSEN_VALUE_EDEFAULT = 0.0; |
| 41 | |
| 42 | /** |
| 43 | * The cached value of the '{@link #getChosenValue() <em>Chosen Value</em>}' attribute. |
| 44 | * <!-- begin-user-doc --> |
| 45 | * <!-- end-user-doc --> |
| 46 | * @see #getChosenValue() |
| 47 | * @generated |
| 48 | * @ordered |
| 49 | */ |
| 50 | protected double chosenValue = CHOSEN_VALUE_EDEFAULT; |
| 51 | |
| 52 | /** |
| 53 | * <!-- begin-user-doc --> |
| 54 | * <!-- end-user-doc --> |
| 55 | * @generated |
| 56 | */ |
| 57 | protected ContinousRangeChoiceImpl() { |
| 58 | super(); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * <!-- begin-user-doc --> |
| 63 | * <!-- end-user-doc --> |
| 64 | * @generated |
| 65 | */ |
| 66 | @Override |
| 67 | protected EClass eStaticClass() { |
| 68 | return designdecisionPackage.Literals.CONTINOUS_RANGE_CHOICE; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * <!-- begin-user-doc --> |
| 73 | * <!-- end-user-doc --> |
| 74 | * @generated |
| 75 | */ |
| 76 | public double getChosenValue() { |
| 77 | return chosenValue; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * <!-- begin-user-doc --> |
| 82 | * <!-- end-user-doc --> |
| 83 | * @generated |
| 84 | */ |
| 85 | public void setChosenValue(double newChosenValue) { |
| 86 | double oldChosenValue = chosenValue; |
| 87 | chosenValue = newChosenValue; |
| 88 | if (eNotificationRequired()) |
| 89 | eNotify(new ENotificationImpl(this, Notification.SET, designdecisionPackage.CONTINOUS_RANGE_CHOICE__CHOSEN_VALUE, oldChosenValue, chosenValue)); |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * <!-- begin-user-doc --> |
| 94 | * <!-- end-user-doc --> |
| 95 | * @generated |
| 96 | */ |
| 97 | @Override |
| 98 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 99 | switch (featureID) { |
| 100 | case designdecisionPackage.CONTINOUS_RANGE_CHOICE__CHOSEN_VALUE: |
| 101 | return getChosenValue(); |
| 102 | } |
| 103 | return super.eGet(featureID, resolve, coreType); |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * <!-- begin-user-doc --> |
| 108 | * <!-- end-user-doc --> |
| 109 | * @generated |
| 110 | */ |
| 111 | @Override |
| 112 | public void eSet(int featureID, Object newValue) { |
| 113 | switch (featureID) { |
| 114 | case designdecisionPackage.CONTINOUS_RANGE_CHOICE__CHOSEN_VALUE: |
| 115 | setChosenValue((Double)newValue); |
| 116 | return; |
| 117 | } |
| 118 | super.eSet(featureID, newValue); |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * <!-- begin-user-doc --> |
| 123 | * <!-- end-user-doc --> |
| 124 | * @generated |
| 125 | */ |
| 126 | @Override |
| 127 | public void eUnset(int featureID) { |
| 128 | switch (featureID) { |
| 129 | case designdecisionPackage.CONTINOUS_RANGE_CHOICE__CHOSEN_VALUE: |
| 130 | setChosenValue(CHOSEN_VALUE_EDEFAULT); |
| 131 | return; |
| 132 | } |
| 133 | super.eUnset(featureID); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * <!-- begin-user-doc --> |
| 138 | * <!-- end-user-doc --> |
| 139 | * @generated |
| 140 | */ |
| 141 | @Override |
| 142 | public boolean eIsSet(int featureID) { |
| 143 | switch (featureID) { |
| 144 | case designdecisionPackage.CONTINOUS_RANGE_CHOICE__CHOSEN_VALUE: |
| 145 | return chosenValue != CHOSEN_VALUE_EDEFAULT; |
| 146 | } |
| 147 | return super.eIsSet(featureID); |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * <!-- begin-user-doc --> |
| 152 | * <!-- end-user-doc --> |
| 153 | * @generated |
| 154 | */ |
| 155 | @Override |
| 156 | public String toString() { |
| 157 | if (eIsProxy()) return super.toString(); |
| 158 | |
| 159 | StringBuffer result = new StringBuffer(super.toString()); |
| 160 | result.append(" (chosenValue: "); |
| 161 | result.append(chosenValue); |
| 162 | result.append(')'); |
| 163 | return result.toString(); |
| 164 | } |
| 165 | |
| 166 | } //ContinousRangeChoiceImpl |