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