3 package org.opendaylight.nemo.tool.eclipse.plugin.editor.impl;
5 import org.eclipse.emf.common.notify.Notification;
7 import org.eclipse.emf.ecore.EClass;
9 import org.eclipse.emf.ecore.impl.ENotificationImpl;
10 import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
12 import org.opendaylight.nemo.tool.eclipse.plugin.editor.EditorPackage;
13 import org.opendaylight.nemo.tool.eclipse.plugin.editor.NodeModel;
16 * <!-- begin-user-doc -->
17 * An implementation of the model object '<em><b>Node Model</b></em>'.
18 * <!-- end-user-doc -->
20 * The following features are implemented:
23 * <li>{@link org.opendaylight.nemo.tool.eclipse.plugin.editor.impl.NodeModelImpl#getName <em>Name</em>}</li>
28 public class NodeModelImpl extends MinimalEObjectImpl.Container implements NodeModel
31 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
32 * <!-- begin-user-doc -->
33 * <!-- end-user-doc -->
38 protected static final String NAME_EDEFAULT = null;
41 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
42 * <!-- begin-user-doc -->
43 * <!-- end-user-doc -->
48 protected String name = NAME_EDEFAULT;
51 * <!-- begin-user-doc -->
52 * <!-- end-user-doc -->
55 protected NodeModelImpl()
61 * <!-- begin-user-doc -->
62 * <!-- end-user-doc -->
66 protected EClass eStaticClass()
68 return EditorPackage.Literals.NODE_MODEL;
72 * <!-- begin-user-doc -->
73 * <!-- end-user-doc -->
76 public String getName()
82 * <!-- begin-user-doc -->
83 * <!-- end-user-doc -->
86 public void setName(String newName)
88 String oldName = name;
90 if (eNotificationRequired())
91 eNotify(new ENotificationImpl(this, Notification.SET, EditorPackage.NODE_MODEL__NAME, oldName, name));
95 * <!-- begin-user-doc -->
96 * <!-- end-user-doc -->
100 public Object eGet(int featureID, boolean resolve, boolean coreType)
104 case EditorPackage.NODE_MODEL__NAME:
107 return super.eGet(featureID, resolve, coreType);
111 * <!-- begin-user-doc -->
112 * <!-- end-user-doc -->
116 public void eSet(int featureID, Object newValue)
120 case EditorPackage.NODE_MODEL__NAME:
121 setName((String)newValue);
124 super.eSet(featureID, newValue);
128 * <!-- begin-user-doc -->
129 * <!-- end-user-doc -->
133 public void eUnset(int featureID)
137 case EditorPackage.NODE_MODEL__NAME:
138 setName(NAME_EDEFAULT);
141 super.eUnset(featureID);
145 * <!-- begin-user-doc -->
146 * <!-- end-user-doc -->
150 public boolean eIsSet(int featureID)
154 case EditorPackage.NODE_MODEL__NAME:
155 return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
157 return super.eIsSet(featureID);
161 * <!-- begin-user-doc -->
162 * <!-- end-user-doc -->
166 public String toString()
168 if (eIsProxy()) return super.toString();
170 StringBuffer result = new StringBuffer(super.toString());
171 result.append(" (name: ");
174 return result.toString();