| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package LqnCore.impl; |
| 8 | |
| 9 | import LqnCore.AsynchCallType; |
| 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 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 18 | |
| 19 | /** |
| 20 | * <!-- begin-user-doc --> |
| 21 | * An implementation of the model object '<em><b>Asynch Call Type</b></em>'. |
| 22 | * <!-- end-user-doc --> |
| 23 | * <p> |
| 24 | * The following features are implemented: |
| 25 | * <ul> |
| 26 | * <li>{@link LqnCore.impl.AsynchCallTypeImpl#getDest <em>Dest</em>}</li> |
| 27 | * <li>{@link LqnCore.impl.AsynchCallTypeImpl#getFanin <em>Fanin</em>}</li> |
| 28 | * <li>{@link LqnCore.impl.AsynchCallTypeImpl#getFanout <em>Fanout</em>}</li> |
| 29 | * </ul> |
| 30 | * </p> |
| 31 | * |
| 32 | * @generated |
| 33 | */ |
| 34 | public class AsynchCallTypeImpl extends EObjectImpl implements AsynchCallType { |
| 35 | /** |
| 36 | * The default value of the '{@link #getDest() <em>Dest</em>}' attribute. |
| 37 | * <!-- begin-user-doc --> |
| 38 | * <!-- end-user-doc --> |
| 39 | * @see #getDest() |
| 40 | * @generated |
| 41 | * @ordered |
| 42 | */ |
| 43 | protected static final String DEST_EDEFAULT = null; |
| 44 | |
| 45 | /** |
| 46 | * The cached value of the '{@link #getDest() <em>Dest</em>}' attribute. |
| 47 | * <!-- begin-user-doc --> |
| 48 | * <!-- end-user-doc --> |
| 49 | * @see #getDest() |
| 50 | * @generated |
| 51 | * @ordered |
| 52 | */ |
| 53 | protected String dest = DEST_EDEFAULT; |
| 54 | |
| 55 | /** |
| 56 | * The default value of the '{@link #getFanin() <em>Fanin</em>}' attribute. |
| 57 | * <!-- begin-user-doc --> |
| 58 | * <!-- end-user-doc --> |
| 59 | * @see #getFanin() |
| 60 | * @generated |
| 61 | * @ordered |
| 62 | */ |
| 63 | protected static final int FANIN_EDEFAULT = 0; |
| 64 | |
| 65 | /** |
| 66 | * The cached value of the '{@link #getFanin() <em>Fanin</em>}' attribute. |
| 67 | * <!-- begin-user-doc --> |
| 68 | * <!-- end-user-doc --> |
| 69 | * @see #getFanin() |
| 70 | * @generated |
| 71 | * @ordered |
| 72 | */ |
| 73 | protected int fanin = FANIN_EDEFAULT; |
| 74 | |
| 75 | /** |
| 76 | * This is true if the Fanin attribute has been set. |
| 77 | * <!-- begin-user-doc --> |
| 78 | * <!-- end-user-doc --> |
| 79 | * @generated |
| 80 | * @ordered |
| 81 | */ |
| 82 | protected boolean faninESet; |
| 83 | |
| 84 | /** |
| 85 | * The default value of the '{@link #getFanout() <em>Fanout</em>}' attribute. |
| 86 | * <!-- begin-user-doc --> |
| 87 | * <!-- end-user-doc --> |
| 88 | * @see #getFanout() |
| 89 | * @generated |
| 90 | * @ordered |
| 91 | */ |
| 92 | protected static final int FANOUT_EDEFAULT = 0; |
| 93 | |
| 94 | /** |
| 95 | * The cached value of the '{@link #getFanout() <em>Fanout</em>}' attribute. |
| 96 | * <!-- begin-user-doc --> |
| 97 | * <!-- end-user-doc --> |
| 98 | * @see #getFanout() |
| 99 | * @generated |
| 100 | * @ordered |
| 101 | */ |
| 102 | protected int fanout = FANOUT_EDEFAULT; |
| 103 | |
| 104 | /** |
| 105 | * This is true if the Fanout attribute has been set. |
| 106 | * <!-- begin-user-doc --> |
| 107 | * <!-- end-user-doc --> |
| 108 | * @generated |
| 109 | * @ordered |
| 110 | */ |
| 111 | protected boolean fanoutESet; |
| 112 | |
| 113 | /** |
| 114 | * <!-- begin-user-doc --> |
| 115 | * <!-- end-user-doc --> |
| 116 | * @generated |
| 117 | */ |
| 118 | protected AsynchCallTypeImpl() { |
| 119 | super(); |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * <!-- begin-user-doc --> |
| 124 | * <!-- end-user-doc --> |
| 125 | * @generated |
| 126 | */ |
| 127 | @Override |
| 128 | protected EClass eStaticClass() { |
| 129 | return LqnCorePackage.Literals.ASYNCH_CALL_TYPE; |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * <!-- begin-user-doc --> |
| 134 | * <!-- end-user-doc --> |
| 135 | * @generated |
| 136 | */ |
| 137 | public String getDest() { |
| 138 | return dest; |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * <!-- begin-user-doc --> |
| 143 | * <!-- end-user-doc --> |
| 144 | * @generated |
| 145 | */ |
| 146 | public void setDest(String newDest) { |
| 147 | String oldDest = dest; |
| 148 | dest = newDest; |
| 149 | if (eNotificationRequired()) |
| 150 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.ASYNCH_CALL_TYPE__DEST, oldDest, dest)); |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * <!-- begin-user-doc --> |
| 155 | * <!-- end-user-doc --> |
| 156 | * @generated |
| 157 | */ |
| 158 | public int getFanin() { |
| 159 | return fanin; |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * <!-- begin-user-doc --> |
| 164 | * <!-- end-user-doc --> |
| 165 | * @generated |
| 166 | */ |
| 167 | public void setFanin(int newFanin) { |
| 168 | int oldFanin = fanin; |
| 169 | fanin = newFanin; |
| 170 | boolean oldFaninESet = faninESet; |
| 171 | faninESet = true; |
| 172 | if (eNotificationRequired()) |
| 173 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.ASYNCH_CALL_TYPE__FANIN, oldFanin, fanin, !oldFaninESet)); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * <!-- begin-user-doc --> |
| 178 | * <!-- end-user-doc --> |
| 179 | * @generated |
| 180 | */ |
| 181 | public void unsetFanin() { |
| 182 | int oldFanin = fanin; |
| 183 | boolean oldFaninESet = faninESet; |
| 184 | fanin = FANIN_EDEFAULT; |
| 185 | faninESet = false; |
| 186 | if (eNotificationRequired()) |
| 187 | eNotify(new ENotificationImpl(this, Notification.UNSET, LqnCorePackage.ASYNCH_CALL_TYPE__FANIN, oldFanin, FANIN_EDEFAULT, oldFaninESet)); |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * <!-- begin-user-doc --> |
| 192 | * <!-- end-user-doc --> |
| 193 | * @generated |
| 194 | */ |
| 195 | public boolean isSetFanin() { |
| 196 | return faninESet; |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * <!-- begin-user-doc --> |
| 201 | * <!-- end-user-doc --> |
| 202 | * @generated |
| 203 | */ |
| 204 | public int getFanout() { |
| 205 | return fanout; |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * <!-- begin-user-doc --> |
| 210 | * <!-- end-user-doc --> |
| 211 | * @generated |
| 212 | */ |
| 213 | public void setFanout(int newFanout) { |
| 214 | int oldFanout = fanout; |
| 215 | fanout = newFanout; |
| 216 | boolean oldFanoutESet = fanoutESet; |
| 217 | fanoutESet = true; |
| 218 | if (eNotificationRequired()) |
| 219 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.ASYNCH_CALL_TYPE__FANOUT, oldFanout, fanout, !oldFanoutESet)); |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * <!-- begin-user-doc --> |
| 224 | * <!-- end-user-doc --> |
| 225 | * @generated |
| 226 | */ |
| 227 | public void unsetFanout() { |
| 228 | int oldFanout = fanout; |
| 229 | boolean oldFanoutESet = fanoutESet; |
| 230 | fanout = FANOUT_EDEFAULT; |
| 231 | fanoutESet = false; |
| 232 | if (eNotificationRequired()) |
| 233 | eNotify(new ENotificationImpl(this, Notification.UNSET, LqnCorePackage.ASYNCH_CALL_TYPE__FANOUT, oldFanout, FANOUT_EDEFAULT, oldFanoutESet)); |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * <!-- begin-user-doc --> |
| 238 | * <!-- end-user-doc --> |
| 239 | * @generated |
| 240 | */ |
| 241 | public boolean isSetFanout() { |
| 242 | return fanoutESet; |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * <!-- begin-user-doc --> |
| 247 | * <!-- end-user-doc --> |
| 248 | * @generated |
| 249 | */ |
| 250 | @Override |
| 251 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 252 | switch (featureID) { |
| 253 | case LqnCorePackage.ASYNCH_CALL_TYPE__DEST: |
| 254 | return getDest(); |
| 255 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANIN: |
| 256 | return new Integer(getFanin()); |
| 257 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANOUT: |
| 258 | return new Integer(getFanout()); |
| 259 | } |
| 260 | return super.eGet(featureID, resolve, coreType); |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * <!-- begin-user-doc --> |
| 265 | * <!-- end-user-doc --> |
| 266 | * @generated |
| 267 | */ |
| 268 | @Override |
| 269 | public void eSet(int featureID, Object newValue) { |
| 270 | switch (featureID) { |
| 271 | case LqnCorePackage.ASYNCH_CALL_TYPE__DEST: |
| 272 | setDest((String)newValue); |
| 273 | return; |
| 274 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANIN: |
| 275 | setFanin(((Integer)newValue).intValue()); |
| 276 | return; |
| 277 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANOUT: |
| 278 | setFanout(((Integer)newValue).intValue()); |
| 279 | return; |
| 280 | } |
| 281 | super.eSet(featureID, newValue); |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * <!-- begin-user-doc --> |
| 286 | * <!-- end-user-doc --> |
| 287 | * @generated |
| 288 | */ |
| 289 | @Override |
| 290 | public void eUnset(int featureID) { |
| 291 | switch (featureID) { |
| 292 | case LqnCorePackage.ASYNCH_CALL_TYPE__DEST: |
| 293 | setDest(DEST_EDEFAULT); |
| 294 | return; |
| 295 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANIN: |
| 296 | unsetFanin(); |
| 297 | return; |
| 298 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANOUT: |
| 299 | unsetFanout(); |
| 300 | return; |
| 301 | } |
| 302 | super.eUnset(featureID); |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * <!-- begin-user-doc --> |
| 307 | * <!-- end-user-doc --> |
| 308 | * @generated |
| 309 | */ |
| 310 | @Override |
| 311 | public boolean eIsSet(int featureID) { |
| 312 | switch (featureID) { |
| 313 | case LqnCorePackage.ASYNCH_CALL_TYPE__DEST: |
| 314 | return DEST_EDEFAULT == null ? dest != null : !DEST_EDEFAULT.equals(dest); |
| 315 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANIN: |
| 316 | return isSetFanin(); |
| 317 | case LqnCorePackage.ASYNCH_CALL_TYPE__FANOUT: |
| 318 | return isSetFanout(); |
| 319 | } |
| 320 | return super.eIsSet(featureID); |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * <!-- begin-user-doc --> |
| 325 | * <!-- end-user-doc --> |
| 326 | * @generated |
| 327 | */ |
| 328 | @Override |
| 329 | public String toString() { |
| 330 | if (eIsProxy()) return super.toString(); |
| 331 | |
| 332 | StringBuffer result = new StringBuffer(super.toString()); |
| 333 | result.append(" (dest: "); |
| 334 | result.append(dest); |
| 335 | result.append(", fanin: "); |
| 336 | if (faninESet) result.append(fanin); else result.append("<unset>"); |
| 337 | result.append(", fanout: "); |
| 338 | if (fanoutESet) result.append(fanout); else result.append("<unset>"); |
| 339 | result.append(')'); |
| 340 | return result.toString(); |
| 341 | } |
| 342 | |
| 343 | } //AsynchCallTypeImpl |