/** */ package de.gebit.integrity.dsl.impl; import de.gebit.integrity.dsl.Constant; import de.gebit.integrity.dsl.ConstantEntity; import de.gebit.integrity.dsl.DslPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Constant</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link de.gebit.integrity.dsl.impl.ConstantImpl#getName <em>Name</em>}</li> * </ul> * * @generated */ public class ConstantImpl extends ConstantValueImpl implements Constant { /** * The cached value of the '{@link #getName() <em>Name</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected ConstantEntity name; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ConstantImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DslPackage.Literals.CONSTANT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ConstantEntity getName() { if (name != null && name.eIsProxy()) { InternalEObject oldName = (InternalEObject)name; name = (ConstantEntity)eResolveProxy(oldName); if (name != oldName) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, DslPackage.CONSTANT__NAME, oldName, name)); } } return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ConstantEntity basicGetName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(ConstantEntity newName) { ConstantEntity oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.CONSTANT__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DslPackage.CONSTANT__NAME: if (resolve) return getName(); return basicGetName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DslPackage.CONSTANT__NAME: setName((ConstantEntity)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DslPackage.CONSTANT__NAME: setName((ConstantEntity)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DslPackage.CONSTANT__NAME: return name != null; } return super.eIsSet(featureID); } } //ConstantImpl