/** */ package org.archstudio.xadl3.variability_3_0.impl; import java.util.Collection; import org.archstudio.xadl3.variability_3_0.Change; import org.archstudio.xadl3.variability_3_0.ElementChange; import org.archstudio.xadl3.variability_3_0.Variability_3_0Package; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> An implementation of the model object '<em><b>Element Change</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.archstudio.xadl3.variability_3_0.impl.ElementChangeImpl#getChange <em>Change</em>}</li> * <li>{@link org.archstudio.xadl3.variability_3_0.impl.ElementChangeImpl#getType <em>Type</em>}</li> * </ul> * * @generated */ public class ElementChangeImpl extends ChangeImpl implements ElementChange { /** * The cached value of the '{@link #getChange() <em>Change</em>}' containment reference list. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @see #getChange() * @generated * @ordered */ protected EList<Change> change; /** * The default value of the '{@link #getType() <em>Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getType() * @generated * @ordered */ protected static final String TYPE_EDEFAULT = null; /** * The cached value of the '{@link #getType() <em>Type</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> * * @see #getType() * @generated * @ordered */ protected String type = TYPE_EDEFAULT; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected ElementChangeImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return Variability_3_0Package.Literals.ELEMENT_CHANGE; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EList<Change> getChange() { if (change == null) { change = new EObjectContainmentEList<Change>(Change.class, this, Variability_3_0Package.ELEMENT_CHANGE__CHANGE); } return change; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getType() { return type; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setType(String newType) { String oldType = type; type = newType; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Variability_3_0Package.ELEMENT_CHANGE__TYPE, oldType, type)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Variability_3_0Package.ELEMENT_CHANGE__CHANGE: return ((InternalEList<?>) getChange()).basicRemove(otherEnd, 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 Variability_3_0Package.ELEMENT_CHANGE__CHANGE: return getChange(); case Variability_3_0Package.ELEMENT_CHANGE__TYPE: return getType(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Variability_3_0Package.ELEMENT_CHANGE__CHANGE: getChange().clear(); getChange().addAll((Collection<? extends Change>) newValue); return; case Variability_3_0Package.ELEMENT_CHANGE__TYPE: setType((String) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Variability_3_0Package.ELEMENT_CHANGE__CHANGE: getChange().clear(); return; case Variability_3_0Package.ELEMENT_CHANGE__TYPE: setType(TYPE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Variability_3_0Package.ELEMENT_CHANGE__CHANGE: return change != null && !change.isEmpty(); case Variability_3_0Package.ELEMENT_CHANGE__TYPE: return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); } 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(" (type: "); result.append(type); result.append(')'); return result.toString(); } } // ElementChangeImpl