/** */ package org.eclipse.incquery.snapshot.EIQSnapshot.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.incquery.snapshot.EIQSnapshot.EIQSnapshotPackage; import org.eclipse.incquery.snapshot.EIQSnapshot.EMFSubstitution; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>EMF Substitution</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.incquery.snapshot.EIQSnapshot.impl.EMFSubstitutionImpl#getValue <em>Value</em>}</li> * </ul> * </p> * * @generated */ public class EMFSubstitutionImpl extends MatchSubstitutionRecordImpl implements EMFSubstitution { /** * The cached value of the '{@link #getValue() <em>Value</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected EObject value; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EMFSubstitutionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return EIQSnapshotPackage.Literals.EMF_SUBSTITUTION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EObject getValue() { if (value != null && value.eIsProxy()) { InternalEObject oldValue = (InternalEObject)value; value = eResolveProxy(oldValue); if (value != oldValue) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, EIQSnapshotPackage.EMF_SUBSTITUTION__VALUE, oldValue, value)); } } return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EObject basicGetValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(EObject newValue) { EObject oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EIQSnapshotPackage.EMF_SUBSTITUTION__VALUE, oldValue, value)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case EIQSnapshotPackage.EMF_SUBSTITUTION__VALUE: if (resolve) return getValue(); return basicGetValue(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EIQSnapshotPackage.EMF_SUBSTITUTION__VALUE: setValue((EObject)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EIQSnapshotPackage.EMF_SUBSTITUTION__VALUE: setValue((EObject)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case EIQSnapshotPackage.EMF_SUBSTITUTION__VALUE: return value != null; } return super.eIsSet(featureID); } } //EMFSubstitutionImpl