/** * generated by Xtext 2.23.0 */ package xtext.game.impl; import java.util.Collection; 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.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EDataTypeEList; import xtext.game.Condition; import xtext.game.GamePackage; import xtext.game.Transformation; /** * * An implementation of the model object 'Transformation'. * *

* The following features are implemented: *

* * * @generated */ public class TransformationImpl extends MinimalEObjectImpl.Container implements Transformation { /** * The cached value of the '{@link #getCondition() Condition}' containment reference. * * * @see #getCondition() * @generated * @ordered */ protected Condition condition; /** * The cached value of the '{@link #getObjetsIn() Objets In}' attribute list. * * * @see #getObjetsIn() * @generated * @ordered */ protected EList objetsIn; /** * The cached value of the '{@link #getObjetsOut() Objets Out}' attribute list. * * * @see #getObjetsOut() * @generated * @ordered */ protected EList objetsOut; /** * * * @generated */ protected TransformationImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return GamePackage.Literals.TRANSFORMATION; } /** * * * @generated */ @Override public Condition getCondition() { return condition; } /** * * * @generated */ public NotificationChain basicSetCondition(Condition newCondition, NotificationChain msgs) { Condition oldCondition = condition; condition = newCondition; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GamePackage.TRANSFORMATION__CONDITION, oldCondition, newCondition); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setCondition(Condition newCondition) { if (newCondition != condition) { NotificationChain msgs = null; if (condition != null) msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GamePackage.TRANSFORMATION__CONDITION, null, msgs); if (newCondition != null) msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GamePackage.TRANSFORMATION__CONDITION, null, msgs); msgs = basicSetCondition(newCondition, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.TRANSFORMATION__CONDITION, newCondition, newCondition)); } /** * * * @generated */ @Override public EList getObjetsIn() { if (objetsIn == null) { objetsIn = new EDataTypeEList(String.class, this, GamePackage.TRANSFORMATION__OBJETS_IN); } return objetsIn; } /** * * * @generated */ @Override public EList getObjetsOut() { if (objetsOut == null) { objetsOut = new EDataTypeEList(String.class, this, GamePackage.TRANSFORMATION__OBJETS_OUT); } return objetsOut; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GamePackage.TRANSFORMATION__CONDITION: return basicSetCondition(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GamePackage.TRANSFORMATION__CONDITION: return getCondition(); case GamePackage.TRANSFORMATION__OBJETS_IN: return getObjetsIn(); case GamePackage.TRANSFORMATION__OBJETS_OUT: return getObjetsOut(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GamePackage.TRANSFORMATION__CONDITION: setCondition((Condition)newValue); return; case GamePackage.TRANSFORMATION__OBJETS_IN: getObjetsIn().clear(); getObjetsIn().addAll((Collection)newValue); return; case GamePackage.TRANSFORMATION__OBJETS_OUT: getObjetsOut().clear(); getObjetsOut().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GamePackage.TRANSFORMATION__CONDITION: setCondition((Condition)null); return; case GamePackage.TRANSFORMATION__OBJETS_IN: getObjetsIn().clear(); return; case GamePackage.TRANSFORMATION__OBJETS_OUT: getObjetsOut().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GamePackage.TRANSFORMATION__CONDITION: return condition != null; case GamePackage.TRANSFORMATION__OBJETS_IN: return objetsIn != null && !objetsIn.isEmpty(); case GamePackage.TRANSFORMATION__OBJETS_OUT: return objetsOut != null && !objetsOut.isEmpty(); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (objetsIn: "); result.append(objetsIn); result.append(", objetsOut: "); result.append(objetsOut); result.append(')'); return result.toString(); } } //TransformationImpl