/** */ package org.example.smalljava.smallJava.impl; 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; import org.example.smalljava.smallJava.SJClass; import org.example.smalljava.smallJava.SJNew; import org.example.smalljava.smallJava.SmallJavaPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>SJ New</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.example.smalljava.smallJava.impl.SJNewImpl#getType <em>Type</em>}</li> * </ul> * </p> * * @generated */ public class SJNewImpl extends SJExpressionImpl implements SJNew { /** * The cached value of the '{@link #getType() <em>Type</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected SJClass type; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SJNewImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return SmallJavaPackage.Literals.SJ_NEW; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SJClass getType() { if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (SJClass)eResolveProxy(oldType); if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, SmallJavaPackage.SJ_NEW__TYPE, oldType, type)); } } return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SJClass basicGetType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(SJClass newType) { SJClass oldType = type; type = newType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SmallJavaPackage.SJ_NEW__TYPE, oldType, type)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SmallJavaPackage.SJ_NEW__TYPE: if (resolve) return getType(); return basicGetType(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SmallJavaPackage.SJ_NEW__TYPE: setType((SJClass)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SmallJavaPackage.SJ_NEW__TYPE: setType((SJClass)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SmallJavaPackage.SJ_NEW__TYPE: return type != null; } return super.eIsSet(featureID); } } //SJNewImpl