| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package LqnCore.impl; |
| 8 | |
| 9 | import LqnCore.ActivityOrType; |
| 10 | import LqnCore.LqnCorePackage; |
| 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>Activity Or Type</b></em>'. |
| 21 | * <!-- end-user-doc --> |
| 22 | * <p> |
| 23 | * The following features are implemented: |
| 24 | * <ul> |
| 25 | * <li>{@link LqnCore.impl.ActivityOrTypeImpl#getProb <em>Prob</em>}</li> |
| 26 | * </ul> |
| 27 | * </p> |
| 28 | * |
| 29 | * @generated |
| 30 | */ |
| 31 | public class ActivityOrTypeImpl extends ActivityTypeImpl implements ActivityOrType { |
| 32 | /** |
| 33 | * The default value of the '{@link #getProb() <em>Prob</em>}' attribute. |
| 34 | * <!-- begin-user-doc --> |
| 35 | * <!-- end-user-doc --> |
| 36 | * @see #getProb() |
| 37 | * @generated |
| 38 | * @ordered |
| 39 | */ |
| 40 | protected static final String PROB_EDEFAULT = "1"; |
| 41 | |
| 42 | /** |
| 43 | * The cached value of the '{@link #getProb() <em>Prob</em>}' attribute. |
| 44 | * <!-- begin-user-doc --> |
| 45 | * <!-- end-user-doc --> |
| 46 | * @see #getProb() |
| 47 | * @generated |
| 48 | * @ordered |
| 49 | */ |
| 50 | protected String prob = PROB_EDEFAULT; |
| 51 | |
| 52 | /** |
| 53 | * This is true if the Prob attribute has been set. |
| 54 | * <!-- begin-user-doc --> |
| 55 | * <!-- end-user-doc --> |
| 56 | * @generated |
| 57 | * @ordered |
| 58 | */ |
| 59 | protected boolean probESet; |
| 60 | |
| 61 | /** |
| 62 | * <!-- begin-user-doc --> |
| 63 | * <!-- end-user-doc --> |
| 64 | * @generated |
| 65 | */ |
| 66 | protected ActivityOrTypeImpl() { |
| 67 | super(); |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * <!-- begin-user-doc --> |
| 72 | * <!-- end-user-doc --> |
| 73 | * @generated |
| 74 | */ |
| 75 | @Override |
| 76 | protected EClass eStaticClass() { |
| 77 | return LqnCorePackage.Literals.ACTIVITY_OR_TYPE; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * <!-- begin-user-doc --> |
| 82 | * <!-- end-user-doc --> |
| 83 | * @generated |
| 84 | */ |
| 85 | public String getProb() { |
| 86 | return prob; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * <!-- begin-user-doc --> |
| 91 | * <!-- end-user-doc --> |
| 92 | * @generated |
| 93 | */ |
| 94 | public void setProb(String newProb) { |
| 95 | String oldProb = prob; |
| 96 | prob = newProb; |
| 97 | boolean oldProbESet = probESet; |
| 98 | probESet = true; |
| 99 | if (eNotificationRequired()) |
| 100 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.ACTIVITY_OR_TYPE__PROB, oldProb, prob, !oldProbESet)); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * <!-- begin-user-doc --> |
| 105 | * <!-- end-user-doc --> |
| 106 | * @generated |
| 107 | */ |
| 108 | public void unsetProb() { |
| 109 | String oldProb = prob; |
| 110 | boolean oldProbESet = probESet; |
| 111 | prob = PROB_EDEFAULT; |
| 112 | probESet = false; |
| 113 | if (eNotificationRequired()) |
| 114 | eNotify(new ENotificationImpl(this, Notification.UNSET, LqnCorePackage.ACTIVITY_OR_TYPE__PROB, oldProb, PROB_EDEFAULT, oldProbESet)); |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * <!-- begin-user-doc --> |
| 119 | * <!-- end-user-doc --> |
| 120 | * @generated |
| 121 | */ |
| 122 | public boolean isSetProb() { |
| 123 | return probESet; |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * <!-- begin-user-doc --> |
| 128 | * <!-- end-user-doc --> |
| 129 | * @generated |
| 130 | */ |
| 131 | @Override |
| 132 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 133 | switch (featureID) { |
| 134 | case LqnCorePackage.ACTIVITY_OR_TYPE__PROB: |
| 135 | return getProb(); |
| 136 | } |
| 137 | return super.eGet(featureID, resolve, coreType); |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * <!-- begin-user-doc --> |
| 142 | * <!-- end-user-doc --> |
| 143 | * @generated |
| 144 | */ |
| 145 | @Override |
| 146 | public void eSet(int featureID, Object newValue) { |
| 147 | switch (featureID) { |
| 148 | case LqnCorePackage.ACTIVITY_OR_TYPE__PROB: |
| 149 | setProb((String)newValue); |
| 150 | return; |
| 151 | } |
| 152 | super.eSet(featureID, newValue); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * <!-- begin-user-doc --> |
| 157 | * <!-- end-user-doc --> |
| 158 | * @generated |
| 159 | */ |
| 160 | @Override |
| 161 | public void eUnset(int featureID) { |
| 162 | switch (featureID) { |
| 163 | case LqnCorePackage.ACTIVITY_OR_TYPE__PROB: |
| 164 | unsetProb(); |
| 165 | return; |
| 166 | } |
| 167 | super.eUnset(featureID); |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * <!-- begin-user-doc --> |
| 172 | * <!-- end-user-doc --> |
| 173 | * @generated |
| 174 | */ |
| 175 | @Override |
| 176 | public boolean eIsSet(int featureID) { |
| 177 | switch (featureID) { |
| 178 | case LqnCorePackage.ACTIVITY_OR_TYPE__PROB: |
| 179 | return isSetProb(); |
| 180 | } |
| 181 | return super.eIsSet(featureID); |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * <!-- begin-user-doc --> |
| 186 | * <!-- end-user-doc --> |
| 187 | * @generated |
| 188 | */ |
| 189 | @Override |
| 190 | public String toString() { |
| 191 | if (eIsProxy()) return super.toString(); |
| 192 | |
| 193 | StringBuffer result = new StringBuffer(super.toString()); |
| 194 | result.append(" (prob: "); |
| 195 | if (probESet) result.append(prob); else result.append("<unset>"); |
| 196 | result.append(')'); |
| 197 | return result.toString(); |
| 198 | } |
| 199 | |
| 200 | } //ActivityOrTypeImpl |