/** */ package at.bestsolution.efxclipse.tooling.css.cssDsl.impl; import at.bestsolution.efxclipse.tooling.css.cssDsl.CssDslPackage; import at.bestsolution.efxclipse.tooling.css.cssDsl.URLType; import at.bestsolution.efxclipse.tooling.css.cssDsl.function; import at.bestsolution.efxclipse.tooling.css.cssDsl.term; 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>term</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.termImpl#getNumber <em>Number</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.termImpl#getStringValue <em>String Value</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.termImpl#getIdentifier <em>Identifier</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.termImpl#getUrl <em>Url</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.termImpl#getFunction <em>Function</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.termImpl#getHexColor <em>Hex Color</em>}</li> * </ul> * </p> * * @generated */ public class termImpl extends MinimalEObjectImpl.Container implements term { /** * The default value of the '{@link #getNumber() <em>Number</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getNumber() * @generated * @ordered */ protected static final String NUMBER_EDEFAULT = null; /** * The cached value of the '{@link #getNumber() <em>Number</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getNumber() * @generated * @ordered */ protected String number = NUMBER_EDEFAULT; /** * The default value of the '{@link #getStringValue() <em>String Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getStringValue() * @generated * @ordered */ protected static final String STRING_VALUE_EDEFAULT = null; /** * The cached value of the '{@link #getStringValue() <em>String Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getStringValue() * @generated * @ordered */ protected String stringValue = STRING_VALUE_EDEFAULT; /** * The default value of the '{@link #getIdentifier() <em>Identifier</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getIdentifier() * @generated * @ordered */ protected static final String IDENTIFIER_EDEFAULT = null; /** * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getIdentifier() * @generated * @ordered */ protected String identifier = IDENTIFIER_EDEFAULT; /** * The cached value of the '{@link #getUrl() <em>Url</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getUrl() * @generated * @ordered */ protected URLType url; /** * The cached value of the '{@link #getFunction() <em>Function</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFunction() * @generated * @ordered */ protected function function; /** * The default value of the '{@link #getHexColor() <em>Hex Color</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHexColor() * @generated * @ordered */ protected static final String HEX_COLOR_EDEFAULT = null; /** * The cached value of the '{@link #getHexColor() <em>Hex Color</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHexColor() * @generated * @ordered */ protected String hexColor = HEX_COLOR_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected termImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CssDslPackage.Literals.TERM; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getNumber() { return number; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setNumber(String newNumber) { String oldNumber = number; number = newNumber; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__NUMBER, oldNumber, number)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getStringValue() { return stringValue; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setStringValue(String newStringValue) { String oldStringValue = stringValue; stringValue = newStringValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__STRING_VALUE, oldStringValue, stringValue)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getIdentifier() { return identifier; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setIdentifier(String newIdentifier) { String oldIdentifier = identifier; identifier = newIdentifier; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__IDENTIFIER, oldIdentifier, identifier)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public URLType getUrl() { return url; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetUrl(URLType newUrl, NotificationChain msgs) { URLType oldUrl = url; url = newUrl; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__URL, oldUrl, newUrl); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setUrl(URLType newUrl) { if (newUrl != url) { NotificationChain msgs = null; if (url != null) msgs = ((InternalEObject)url).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CssDslPackage.TERM__URL, null, msgs); if (newUrl != null) msgs = ((InternalEObject)newUrl).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CssDslPackage.TERM__URL, null, msgs); msgs = basicSetUrl(newUrl, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__URL, newUrl, newUrl)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public function getFunction() { return function; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetFunction(function newFunction, NotificationChain msgs) { function oldFunction = function; function = newFunction; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__FUNCTION, oldFunction, newFunction); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFunction(function newFunction) { if (newFunction != function) { NotificationChain msgs = null; if (function != null) msgs = ((InternalEObject)function).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CssDslPackage.TERM__FUNCTION, null, msgs); if (newFunction != null) msgs = ((InternalEObject)newFunction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CssDslPackage.TERM__FUNCTION, null, msgs); msgs = basicSetFunction(newFunction, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__FUNCTION, newFunction, newFunction)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getHexColor() { return hexColor; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setHexColor(String newHexColor) { String oldHexColor = hexColor; hexColor = newHexColor; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CssDslPackage.TERM__HEX_COLOR, oldHexColor, hexColor)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CssDslPackage.TERM__URL: return basicSetUrl(null, msgs); case CssDslPackage.TERM__FUNCTION: return basicSetFunction(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 CssDslPackage.TERM__NUMBER: return getNumber(); case CssDslPackage.TERM__STRING_VALUE: return getStringValue(); case CssDslPackage.TERM__IDENTIFIER: return getIdentifier(); case CssDslPackage.TERM__URL: return getUrl(); case CssDslPackage.TERM__FUNCTION: return getFunction(); case CssDslPackage.TERM__HEX_COLOR: return getHexColor(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CssDslPackage.TERM__NUMBER: setNumber((String)newValue); return; case CssDslPackage.TERM__STRING_VALUE: setStringValue((String)newValue); return; case CssDslPackage.TERM__IDENTIFIER: setIdentifier((String)newValue); return; case CssDslPackage.TERM__URL: setUrl((URLType)newValue); return; case CssDslPackage.TERM__FUNCTION: setFunction((function)newValue); return; case CssDslPackage.TERM__HEX_COLOR: setHexColor((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CssDslPackage.TERM__NUMBER: setNumber(NUMBER_EDEFAULT); return; case CssDslPackage.TERM__STRING_VALUE: setStringValue(STRING_VALUE_EDEFAULT); return; case CssDslPackage.TERM__IDENTIFIER: setIdentifier(IDENTIFIER_EDEFAULT); return; case CssDslPackage.TERM__URL: setUrl((URLType)null); return; case CssDslPackage.TERM__FUNCTION: setFunction((function)null); return; case CssDslPackage.TERM__HEX_COLOR: setHexColor(HEX_COLOR_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CssDslPackage.TERM__NUMBER: return NUMBER_EDEFAULT == null ? number != null : !NUMBER_EDEFAULT.equals(number); case CssDslPackage.TERM__STRING_VALUE: return STRING_VALUE_EDEFAULT == null ? stringValue != null : !STRING_VALUE_EDEFAULT.equals(stringValue); case CssDslPackage.TERM__IDENTIFIER: return IDENTIFIER_EDEFAULT == null ? identifier != null : !IDENTIFIER_EDEFAULT.equals(identifier); case CssDslPackage.TERM__URL: return url != null; case CssDslPackage.TERM__FUNCTION: return function != null; case CssDslPackage.TERM__HEX_COLOR: return HEX_COLOR_EDEFAULT == null ? hexColor != null : !HEX_COLOR_EDEFAULT.equals(hexColor); } 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(" (number: "); result.append(number); result.append(", stringValue: "); result.append(stringValue); result.append(", identifier: "); result.append(identifier); result.append(", hexColor: "); result.append(hexColor); result.append(')'); return result.toString(); } } //termImpl