/** * generated by Xtext 2.14.0 */ package com.minres.rdl.rdl.impl; import com.minres.rdl.rdl.RValue; import com.minres.rdl.rdl.RValueConstant; import com.minres.rdl.rdl.RdlPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * * An implementation of the model object 'RValue'. * *

* The following features are implemented: *

* * * @generated */ public class RValueImpl extends MinimalEObjectImpl.Container implements RValue { /** * The default value of the '{@link #getVal() Val}' attribute. * * * @see #getVal() * @generated * @ordered */ protected static final RValueConstant VAL_EDEFAULT = RValueConstant.UNDEFINED; /** * The cached value of the '{@link #getVal() Val}' attribute. * * * @see #getVal() * @generated * @ordered */ protected RValueConstant val = VAL_EDEFAULT; /** * The default value of the '{@link #getNum() Num}' attribute. * * * @see #getNum() * @generated * @ordered */ protected static final Object NUM_EDEFAULT = null; /** * The cached value of the '{@link #getNum() Num}' attribute. * * * @see #getNum() * @generated * @ordered */ protected Object num = NUM_EDEFAULT; /** * The default value of the '{@link #getStr() Str}' attribute. * * * @see #getStr() * @generated * @ordered */ protected static final String STR_EDEFAULT = null; /** * The cached value of the '{@link #getStr() Str}' attribute. * * * @see #getStr() * @generated * @ordered */ protected String str = STR_EDEFAULT; /** * * * @generated */ protected RValueImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return RdlPackage.Literals.RVALUE; } /** * * * @generated */ public RValueConstant getVal() { return val; } /** * * * @generated */ public void setVal(RValueConstant newVal) { RValueConstant oldVal = val; val = newVal == null ? VAL_EDEFAULT : newVal; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.RVALUE__VAL, oldVal, val)); } /** * * * @generated */ public Object getNum() { return num; } /** * * * @generated */ public void setNum(Object newNum) { Object oldNum = num; num = newNum; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.RVALUE__NUM, oldNum, num)); } /** * * * @generated */ public String getStr() { return str; } /** * * * @generated */ public void setStr(String newStr) { String oldStr = str; str = newStr; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.RVALUE__STR, oldStr, str)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case RdlPackage.RVALUE__VAL: return getVal(); case RdlPackage.RVALUE__NUM: return getNum(); case RdlPackage.RVALUE__STR: return getStr(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case RdlPackage.RVALUE__VAL: setVal((RValueConstant)newValue); return; case RdlPackage.RVALUE__NUM: setNum(newValue); return; case RdlPackage.RVALUE__STR: setStr((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case RdlPackage.RVALUE__VAL: setVal(VAL_EDEFAULT); return; case RdlPackage.RVALUE__NUM: setNum(NUM_EDEFAULT); return; case RdlPackage.RVALUE__STR: setStr(STR_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case RdlPackage.RVALUE__VAL: return val != VAL_EDEFAULT; case RdlPackage.RVALUE__NUM: return NUM_EDEFAULT == null ? num != null : !NUM_EDEFAULT.equals(num); case RdlPackage.RVALUE__STR: return STR_EDEFAULT == null ? str != null : !STR_EDEFAULT.equals(str); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (val: "); result.append(val); result.append(", num: "); result.append(num); result.append(", str: "); result.append(str); result.append(')'); return result.toString(); } } //RValueImpl