/** * generated by Xtext 2.10.0 */ package com.arm.cmsis.pack.debugseq.debugSeq.impl; import com.arm.cmsis.pack.debugseq.debugSeq.DebugSeqPackage; import com.arm.cmsis.pack.debugseq.debugSeq.Expression; import com.arm.cmsis.pack.debugseq.debugSeq.Query; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Query</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.QueryImpl#getType <em>Type</em>}</li> * <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.QueryImpl#getMessage <em>Message</em>}</li> * <li>{@link com.arm.cmsis.pack.debugseq.debugSeq.impl.QueryImpl#getDefault <em>Default</em>}</li> * </ul> * * @generated */ public class QueryImpl extends ExpressionImpl implements Query { /** * The cached value of the '{@link #getType() <em>Type</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected Expression type; /** * The default value of the '{@link #getMessage() <em>Message</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getMessage() * @generated * @ordered */ protected static final String MESSAGE_EDEFAULT = null; /** * The cached value of the '{@link #getMessage() <em>Message</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getMessage() * @generated * @ordered */ protected String message = MESSAGE_EDEFAULT; /** * The cached value of the '{@link #getDefault() <em>Default</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDefault() * @generated * @ordered */ protected Expression default_; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected QueryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DebugSeqPackage.Literals.QUERY; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetType(Expression newType, NotificationChain msgs) { Expression oldType = type; type = newType; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.QUERY__TYPE, oldType, newType); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(Expression newType) { if (newType != type) { NotificationChain msgs = null; if (type != null) msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.QUERY__TYPE, null, msgs); if (newType != null) msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.QUERY__TYPE, null, msgs); msgs = basicSetType(newType, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.QUERY__TYPE, newType, newType)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getMessage() { return message; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setMessage(String newMessage) { String oldMessage = message; message = newMessage; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.QUERY__MESSAGE, oldMessage, message)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getDefault() { return default_; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetDefault(Expression newDefault, NotificationChain msgs) { Expression oldDefault = default_; default_ = newDefault; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DebugSeqPackage.QUERY__DEFAULT, oldDefault, newDefault); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDefault(Expression newDefault) { if (newDefault != default_) { NotificationChain msgs = null; if (default_ != null) msgs = ((InternalEObject)default_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.QUERY__DEFAULT, null, msgs); if (newDefault != null) msgs = ((InternalEObject)newDefault).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DebugSeqPackage.QUERY__DEFAULT, null, msgs); msgs = basicSetDefault(newDefault, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DebugSeqPackage.QUERY__DEFAULT, newDefault, newDefault)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DebugSeqPackage.QUERY__TYPE: return basicSetType(null, msgs); case DebugSeqPackage.QUERY__DEFAULT: return basicSetDefault(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 DebugSeqPackage.QUERY__TYPE: return getType(); case DebugSeqPackage.QUERY__MESSAGE: return getMessage(); case DebugSeqPackage.QUERY__DEFAULT: return getDefault(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DebugSeqPackage.QUERY__TYPE: setType((Expression)newValue); return; case DebugSeqPackage.QUERY__MESSAGE: setMessage((String)newValue); return; case DebugSeqPackage.QUERY__DEFAULT: setDefault((Expression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DebugSeqPackage.QUERY__TYPE: setType((Expression)null); return; case DebugSeqPackage.QUERY__MESSAGE: setMessage(MESSAGE_EDEFAULT); return; case DebugSeqPackage.QUERY__DEFAULT: setDefault((Expression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DebugSeqPackage.QUERY__TYPE: return type != null; case DebugSeqPackage.QUERY__MESSAGE: return MESSAGE_EDEFAULT == null ? message != null : !MESSAGE_EDEFAULT.equals(message); case DebugSeqPackage.QUERY__DEFAULT: return default_ != null; } 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(" (message: "); result.append(message); result.append(')'); return result.toString(); } } //QueryImpl