/** */ package org.archstudio.xadl3.hints_3_0.impl; import org.archstudio.xadl3.hints_3_0.Hint; import org.archstudio.xadl3.hints_3_0.Hints_3_0Package; import org.archstudio.xadl3.hints_3_0.Value; 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 org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * <!-- begin-user-doc --> An implementation of the model object '<em><b>Hint</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.archstudio.xadl3.hints_3_0.impl.HintImpl#getValue <em>Value</em>}</li> * <li>{@link org.archstudio.xadl3.hints_3_0.impl.HintImpl#getHint <em>Hint</em>}</li> * <li>{@link org.archstudio.xadl3.hints_3_0.impl.HintImpl#getName <em>Name</em>}</li> * </ul> * * @generated */ public class HintImpl extends MinimalEObjectImpl.Container implements Hint { /** * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. <!-- begin-user-doc --> <!-- * end-user-doc --> * * @see #getValue() * @generated * @ordered */ protected Value value; /** * The default value of the '{@link #getHint() <em>Hint</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getHint() * @generated * @ordered */ protected static final String HINT_EDEFAULT = null; /** * The cached value of the '{@link #getHint() <em>Hint</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getHint() * @generated * @ordered */ protected String hint = HINT_EDEFAULT; /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected HintImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return Hints_3_0Package.Literals.HINT; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public Value getValue() { return value; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public NotificationChain basicSetValue(Value newValue, NotificationChain msgs) { Value oldValue = value; value = newValue; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Hints_3_0Package.HINT__VALUE, oldValue, newValue); if (msgs == null) { msgs = notification; } else { msgs.add(notification); } } return msgs; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setValue(Value newValue) { if (newValue != value) { NotificationChain msgs = null; if (value != null) { msgs = ((InternalEObject) value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Hints_3_0Package.HINT__VALUE, null, msgs); } if (newValue != null) { msgs = ((InternalEObject) newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Hints_3_0Package.HINT__VALUE, null, msgs); } msgs = basicSetValue(newValue, msgs); if (msgs != null) { msgs.dispatch(); } } else if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Hints_3_0Package.HINT__VALUE, newValue, newValue)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getHint() { return hint; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setHint(String newHint) { String oldHint = hint; hint = newHint; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Hints_3_0Package.HINT__HINT, oldHint, hint)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getName() { return name; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Hints_3_0Package.HINT__NAME, oldName, name)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Hints_3_0Package.HINT__VALUE: return basicSetValue(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 Hints_3_0Package.HINT__VALUE: return getValue(); case Hints_3_0Package.HINT__HINT: return getHint(); case Hints_3_0Package.HINT__NAME: return getName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Hints_3_0Package.HINT__VALUE: setValue((Value) newValue); return; case Hints_3_0Package.HINT__HINT: setHint((String) newValue); return; case Hints_3_0Package.HINT__NAME: setName((String) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Hints_3_0Package.HINT__VALUE: setValue((Value) null); return; case Hints_3_0Package.HINT__HINT: setHint(HINT_EDEFAULT); return; case Hints_3_0Package.HINT__NAME: setName(NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Hints_3_0Package.HINT__VALUE: return value != null; case Hints_3_0Package.HINT__HINT: return HINT_EDEFAULT == null ? hint != null : !HINT_EDEFAULT.equals(hint); case Hints_3_0Package.HINT__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } 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(" (hint: "); result.append(hint); result.append(", name: "); result.append(name); result.append(')'); return result.toString(); } } // HintImpl