001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl;
007:
008: import org.eclipse.emf.common.notify.Notification;
009: import org.eclipse.emf.ecore.EClass;
010: import org.eclipse.emf.ecore.impl.ENotificationImpl;
011: import org.eclipse.emf.ecore.impl.EObjectImpl;
012:
013: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.BaseElement;
014: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.DefaultMepType;
015: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.componentflowPackage;
016:
017: /**
018: * <!-- begin-user-doc -->
019: * An implementation of the model object '<em><b>Base Element</b></em>'.
020: * <!-- end-user-doc -->
021: * <p>
022: * The following features are implemented:
023: * <ul>
024: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.BaseElementImpl#getName <em>Name</em>}</li>
025: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.BaseElementImpl#getDescription <em>Description</em>}</li>
026: * </ul>
027: * </p>
028: *
029: * @generated
030: */
031: public class BaseElementImpl extends EObjectImpl implements BaseElement {
032: /**
033: * <!-- begin-user-doc -->
034: * <!-- end-user-doc -->
035: * @generated
036: */
037: public static final String copyright = "Copyright, Bostech Corp.";
038:
039: /**
040: * The default value of the '{@link #getName() <em>Name</em>}' attribute.
041: * <!-- begin-user-doc -->
042: * <!-- end-user-doc -->
043: * @see #getName()
044: * @generated
045: * @ordered
046: */
047: protected static final String NAME_EDEFAULT = null;
048:
049: /**
050: * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
051: * <!-- begin-user-doc -->
052: * <!-- end-user-doc -->
053: * @see #getName()
054: * @generated
055: * @ordered
056: */
057: protected String name = NAME_EDEFAULT;
058:
059: /**
060: * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
061: * <!-- begin-user-doc -->
062: * <!-- end-user-doc -->
063: * @see #getDescription()
064: * @generated
065: * @ordered
066: */
067: protected static final String DESCRIPTION_EDEFAULT = null;
068:
069: /**
070: * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
071: * <!-- begin-user-doc -->
072: * <!-- end-user-doc -->
073: * @see #getDescription()
074: * @generated
075: * @ordered
076: */
077: protected String description = DESCRIPTION_EDEFAULT;
078:
079: /**
080: * <!-- begin-user-doc -->
081: * <!-- end-user-doc -->
082: * @generated
083: */
084: protected BaseElementImpl() {
085: super ();
086: }
087:
088: /**
089: * <!-- begin-user-doc -->
090: * <!-- end-user-doc -->
091: * @generated
092: */
093: protected EClass eStaticClass() {
094: return componentflowPackage.Literals.BASE_ELEMENT;
095: }
096:
097: /**
098: * <!-- begin-user-doc -->
099: * <!-- end-user-doc -->
100: * @generated
101: */
102: public String getName() {
103: return name;
104: }
105:
106: /**
107: * <!-- begin-user-doc -->
108: * <!-- end-user-doc -->
109: * @generated
110: */
111: public void setName(String newName) {
112: String oldName = name;
113: name = newName;
114: if (eNotificationRequired())
115: eNotify(new ENotificationImpl(this , Notification.SET,
116: componentflowPackage.BASE_ELEMENT__NAME, oldName,
117: name));
118: }
119:
120: /**
121: * <!-- begin-user-doc -->
122: * <!-- end-user-doc -->
123: * @generated
124: */
125: public String getDescription() {
126: return description;
127: }
128:
129: /**
130: * <!-- begin-user-doc -->
131: * <!-- end-user-doc -->
132: * @generated
133: */
134: public void setDescription(String newDescription) {
135: String oldDescription = description;
136: description = newDescription;
137: if (eNotificationRequired())
138: eNotify(new ENotificationImpl(this , Notification.SET,
139: componentflowPackage.BASE_ELEMENT__DESCRIPTION,
140: oldDescription, description));
141: }
142:
143: /**
144: * <!-- begin-user-doc -->
145: * <!-- end-user-doc -->
146: * @generated
147: */
148: public Object eGet(int featureID, boolean resolve, boolean coreType) {
149: switch (featureID) {
150: case componentflowPackage.BASE_ELEMENT__NAME:
151: return getName();
152: case componentflowPackage.BASE_ELEMENT__DESCRIPTION:
153: return getDescription();
154: }
155: return super .eGet(featureID, resolve, coreType);
156: }
157:
158: /**
159: * <!-- begin-user-doc -->
160: * <!-- end-user-doc -->
161: * @generated
162: */
163: public void eSet(int featureID, Object newValue) {
164: switch (featureID) {
165: case componentflowPackage.BASE_ELEMENT__NAME:
166: setName((String) newValue);
167: return;
168: case componentflowPackage.BASE_ELEMENT__DESCRIPTION:
169: setDescription((String) newValue);
170: return;
171: }
172: super .eSet(featureID, newValue);
173: }
174:
175: /**
176: * <!-- begin-user-doc -->
177: * <!-- end-user-doc -->
178: * @generated
179: */
180: public void eUnset(int featureID) {
181: switch (featureID) {
182: case componentflowPackage.BASE_ELEMENT__NAME:
183: setName(NAME_EDEFAULT);
184: return;
185: case componentflowPackage.BASE_ELEMENT__DESCRIPTION:
186: setDescription(DESCRIPTION_EDEFAULT);
187: return;
188: }
189: super .eUnset(featureID);
190: }
191:
192: /**
193: * <!-- begin-user-doc -->
194: * <!-- end-user-doc -->
195: * @generated
196: */
197: public boolean eIsSet(int featureID) {
198: switch (featureID) {
199: case componentflowPackage.BASE_ELEMENT__NAME:
200: return NAME_EDEFAULT == null ? name != null
201: : !NAME_EDEFAULT.equals(name);
202: case componentflowPackage.BASE_ELEMENT__DESCRIPTION:
203: return DESCRIPTION_EDEFAULT == null ? description != null
204: : !DESCRIPTION_EDEFAULT.equals(description);
205: }
206: return super .eIsSet(featureID);
207: }
208:
209: /**
210: * <!-- begin-user-doc -->
211: * <!-- end-user-doc -->
212: * @generated
213: */
214: public String toString() {
215: if (eIsProxy())
216: return super .toString();
217:
218: StringBuffer result = new StringBuffer(super .toString());
219: result.append(" (name: ");
220: result.append(name);
221: result.append(", description: ");
222: result.append(description);
223: result.append(')');
224: return result.toString();
225: }
226:
227: } //BaseElementImpl
|