/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.reuseware.air.language.componentmodel.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.eclipse.emf.ecore.impl.EObjectImpl;
import org.reuseware.air.language.componentmodel.AbstractFragmentType;
import org.reuseware.air.language.componentmodel.AbstractVariationPointName;
import org.reuseware.air.language.componentmodel.ComponentmodelPackage;
import org.reuseware.air.language.componentmodel.VariationPoint;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Variation Point</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.reuseware.air.language.componentmodel.impl.VariationPointImpl#getType <em>Type</em>}</li>
* <li>{@link org.reuseware.air.language.componentmodel.impl.VariationPointImpl#getName <em>Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class VariationPointImpl extends EObjectImpl implements VariationPoint {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected AbstractFragmentType type;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected AbstractVariationPointName name;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected VariationPointImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ComponentmodelPackage.Literals.VARIATION_POINT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AbstractFragmentType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(AbstractFragmentType newType, NotificationChain msgs) {
AbstractFragmentType oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentmodelPackage.VARIATION_POINT__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(AbstractFragmentType newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentmodelPackage.VARIATION_POINT__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentmodelPackage.VARIATION_POINT__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentmodelPackage.VARIATION_POINT__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AbstractVariationPointName getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetName(AbstractVariationPointName newName, NotificationChain msgs) {
AbstractVariationPointName oldName = name;
name = newName;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentmodelPackage.VARIATION_POINT__NAME, oldName, newName);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(AbstractVariationPointName newName) {
if (newName != name) {
NotificationChain msgs = null;
if (name != null)
msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentmodelPackage.VARIATION_POINT__NAME, null, msgs);
if (newName != null)
msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentmodelPackage.VARIATION_POINT__NAME, null, msgs);
msgs = basicSetName(newName, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentmodelPackage.VARIATION_POINT__NAME, newName, newName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ComponentmodelPackage.VARIATION_POINT__TYPE:
return basicSetType(null, msgs);
case ComponentmodelPackage.VARIATION_POINT__NAME:
return basicSetName(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 ComponentmodelPackage.VARIATION_POINT__TYPE:
return getType();
case ComponentmodelPackage.VARIATION_POINT__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 ComponentmodelPackage.VARIATION_POINT__TYPE:
setType((AbstractFragmentType)newValue);
return;
case ComponentmodelPackage.VARIATION_POINT__NAME:
setName((AbstractVariationPointName)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ComponentmodelPackage.VARIATION_POINT__TYPE:
setType((AbstractFragmentType)null);
return;
case ComponentmodelPackage.VARIATION_POINT__NAME:
setName((AbstractVariationPointName)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ComponentmodelPackage.VARIATION_POINT__TYPE:
return type != null;
case ComponentmodelPackage.VARIATION_POINT__NAME:
return name != null;
}
return super.eIsSet(featureID);
}
} //VariationPointImpl