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