/**
*/
package org.erlide.erlang.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 org.erlide.erlang.CompileAttribute;
import org.erlide.erlang.ErlangPackage;
import org.erlide.erlang.Expression;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>Compile Attribute</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.erlide.erlang.impl.CompileAttributeImpl#getOptions <em>Options
* </em>}</li>
* </ul>
*
* @generated
*/
public class CompileAttributeImpl extends AttributeImpl implements
CompileAttribute {
/**
* The cached value of the '{@link #getOptions() <em>Options</em>}'
* containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getOptions()
* @generated
* @ordered
*/
protected Expression options;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected CompileAttributeImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ErlangPackage.Literals.COMPILE_ATTRIBUTE;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Expression getOptions() {
return options;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public NotificationChain basicSetOptions(final Expression newOptions,
NotificationChain msgs) {
final Expression oldOptions = options;
options = newOptions;
if (eNotificationRequired()) {
final ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET, ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS,
oldOptions, newOptions);
if (msgs == null) {
msgs = notification;
} else {
msgs.add(notification);
}
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setOptions(final Expression newOptions) {
if (newOptions != options) {
NotificationChain msgs = null;
if (options != null) {
msgs = ((InternalEObject) options).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE
- ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS,
null, msgs);
}
if (newOptions != null) {
msgs = ((InternalEObject) newOptions).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE
- ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS,
null, msgs);
}
msgs = basicSetOptions(newOptions, msgs);
if (msgs != null) {
msgs.dispatch();
}
} else if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET,
ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS, newOptions,
newOptions));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(final InternalEObject otherEnd,
final int featureID, final NotificationChain msgs) {
switch (featureID) {
case ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS:
return basicSetOptions(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(final int featureID, final boolean resolve,
final boolean coreType) {
switch (featureID) {
case ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS:
return getOptions();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(final int featureID, final Object newValue) {
switch (featureID) {
case ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS:
setOptions((Expression) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(final int featureID) {
switch (featureID) {
case ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS:
setOptions((Expression) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(final int featureID) {
switch (featureID) {
case ErlangPackage.COMPILE_ATTRIBUTE__OPTIONS:
return options != null;
}
return super.eIsSet(featureID);
}
} // CompileAttributeImpl