/** */ package info.limpet.stackedcharts.model.impl; import info.limpet.stackedcharts.model.Datum; import info.limpet.stackedcharts.model.StackedchartsPackage; import java.awt.Color; 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; /** * <!-- begin-user-doc --> An implementation of the model object '<em><b>Datum</b></em>'. <!-- * end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link info.limpet.stackedcharts.model.impl.DatumImpl#getVal <em>Val</em>}</li> * <li>{@link info.limpet.stackedcharts.model.impl.DatumImpl#getColor <em>Color</em>}</li> * </ul> * * @generated */ public class DatumImpl extends MinimalEObjectImpl.Container implements Datum { /** * The default value of the '{@link #getVal() <em>Val</em>}' attribute. <!-- begin-user-doc --> * <!-- end-user-doc --> * * @see #getVal() * @generated * @ordered */ protected static final double VAL_EDEFAULT = 0.0; /** * The cached value of the '{@link #getVal() <em>Val</em>}' attribute. <!-- begin-user-doc --> * <!-- end-user-doc --> * * @see #getVal() * @generated * @ordered */ protected double val = VAL_EDEFAULT; /** * The default value of the '{@link #getColor() <em>Color</em>}' attribute. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @see #getColor() * @generated * @ordered */ protected static final Color COLOR_EDEFAULT = null; /** * The cached value of the '{@link #getColor() <em>Color</em>}' attribute. <!-- begin-user-doc --> * <!-- end-user-doc --> * * @see #getColor() * @generated * @ordered */ protected Color color = COLOR_EDEFAULT; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected DatumImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return StackedchartsPackage.Literals.DATUM; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public double getVal() { return val; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public void setVal(double newVal) { double oldVal = val; val = newVal; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, StackedchartsPackage.DATUM__VAL, oldVal, val)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public Color getColor() { return color; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public void setColor(Color newColor) { Color oldColor = color; color = newColor; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, StackedchartsPackage.DATUM__COLOR, oldColor, color)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case StackedchartsPackage.DATUM__VAL: return getVal(); case StackedchartsPackage.DATUM__COLOR: return getColor(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case StackedchartsPackage.DATUM__VAL: setVal((Double) newValue); return; case StackedchartsPackage.DATUM__COLOR: setColor((Color) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case StackedchartsPackage.DATUM__VAL: setVal(VAL_EDEFAULT); return; case StackedchartsPackage.DATUM__COLOR: setColor(COLOR_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case StackedchartsPackage.DATUM__VAL: return val != VAL_EDEFAULT; case StackedchartsPackage.DATUM__COLOR: return COLOR_EDEFAULT == null ? color != null : !COLOR_EDEFAULT.equals( color); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (val: "); result.append(val); result.append(", color: "); result.append(color); result.append(')'); return result.toString(); } } // DatumImpl