/** * <copyright> * </copyright> * * $Id$ */ package orgomg.cwm.analysis.olap.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import orgomg.cwm.analysis.olap.CodedLevel; import orgomg.cwm.analysis.olap.OlapPackage; import orgomg.cwm.foundation.expressions.ExpressionNode; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Coded Level</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link orgomg.cwm.analysis.olap.impl.CodedLevelImpl#getEncoding <em>Encoding</em>}</li> * </ul> * </p> * * @generated */ public class CodedLevelImpl extends LevelImpl implements CodedLevel { /** * The cached value of the '{@link #getEncoding() <em>Encoding</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getEncoding() * @generated * @ordered */ protected ExpressionNode encoding; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected CodedLevelImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return OlapPackage.Literals.CODED_LEVEL; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ExpressionNode getEncoding() { return encoding; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetEncoding(ExpressionNode newEncoding, NotificationChain msgs) { ExpressionNode oldEncoding = encoding; encoding = newEncoding; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OlapPackage.CODED_LEVEL__ENCODING, oldEncoding, newEncoding); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setEncoding(ExpressionNode newEncoding) { if (newEncoding != encoding) { NotificationChain msgs = null; if (encoding != null) msgs = ((InternalEObject)encoding).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OlapPackage.CODED_LEVEL__ENCODING, null, msgs); if (newEncoding != null) msgs = ((InternalEObject)newEncoding).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OlapPackage.CODED_LEVEL__ENCODING, null, msgs); msgs = basicSetEncoding(newEncoding, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OlapPackage.CODED_LEVEL__ENCODING, newEncoding, newEncoding)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case OlapPackage.CODED_LEVEL__ENCODING: return basicSetEncoding(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case OlapPackage.CODED_LEVEL__ENCODING: return getEncoding(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OlapPackage.CODED_LEVEL__ENCODING: setEncoding((ExpressionNode)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OlapPackage.CODED_LEVEL__ENCODING: setEncoding((ExpressionNode)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OlapPackage.CODED_LEVEL__ENCODING: return encoding != null; } return super.eIsSet(featureID); } } //CodedLevelImpl