/**
* generated by Xtext 2.23.0
*/
package fr.n7.gAME.impl;
import fr.n7.gAME.Chemin;
import fr.n7.gAME.Condition;
import fr.n7.gAME.Description;
import fr.n7.gAME.GAMEPackage;
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 org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Chemin'.
*
*
* The following features are implemented:
*
*
* - {@link fr.n7.gAME.impl.CheminImpl#getLieuIn Lieu In}
* - {@link fr.n7.gAME.impl.CheminImpl#getLieuOut Lieu Out}
* - {@link fr.n7.gAME.impl.CheminImpl#getOuvert Ouvert}
* - {@link fr.n7.gAME.impl.CheminImpl#getVisible Visible}
* - {@link fr.n7.gAME.impl.CheminImpl#getObligatoire Obligatoire}
* - {@link fr.n7.gAME.impl.CheminImpl#getConnaissances Connaissances}
* - {@link fr.n7.gAME.impl.CheminImpl#getObjetsRecus Objets Recus}
* - {@link fr.n7.gAME.impl.CheminImpl#getObjetsConso Objets Conso}
* - {@link fr.n7.gAME.impl.CheminImpl#getDescriptions Descriptions}
*
*
* @generated
*/
public class CheminImpl extends MinimalEObjectImpl.Container implements Chemin
{
/**
* The default value of the '{@link #getLieuIn() Lieu In}' attribute.
*
*
* @see #getLieuIn()
* @generated
* @ordered
*/
protected static final String LIEU_IN_EDEFAULT = null;
/**
* The cached value of the '{@link #getLieuIn() Lieu In}' attribute.
*
*
* @see #getLieuIn()
* @generated
* @ordered
*/
protected String lieuIn = LIEU_IN_EDEFAULT;
/**
* The default value of the '{@link #getLieuOut() Lieu Out}' attribute.
*
*
* @see #getLieuOut()
* @generated
* @ordered
*/
protected static final String LIEU_OUT_EDEFAULT = null;
/**
* The cached value of the '{@link #getLieuOut() Lieu Out}' attribute.
*
*
* @see #getLieuOut()
* @generated
* @ordered
*/
protected String lieuOut = LIEU_OUT_EDEFAULT;
/**
* The cached value of the '{@link #getOuvert() Ouvert}' containment reference.
*
*
* @see #getOuvert()
* @generated
* @ordered
*/
protected Condition ouvert;
/**
* The cached value of the '{@link #getVisible() Visible}' containment reference.
*
*
* @see #getVisible()
* @generated
* @ordered
*/
protected Condition visible;
/**
* The cached value of the '{@link #getObligatoire() Obligatoire}' containment reference.
*
*
* @see #getObligatoire()
* @generated
* @ordered
*/
protected Condition obligatoire;
/**
* The cached value of the '{@link #getConnaissances() Connaissances}' attribute list.
*
*
* @see #getConnaissances()
* @generated
* @ordered
*/
protected EList connaissances;
/**
* The cached value of the '{@link #getObjetsRecus() Objets Recus}' attribute list.
*
*
* @see #getObjetsRecus()
* @generated
* @ordered
*/
protected EList objetsRecus;
/**
* The cached value of the '{@link #getObjetsConso() Objets Conso}' attribute list.
*
*
* @see #getObjetsConso()
* @generated
* @ordered
*/
protected EList objetsConso;
/**
* The cached value of the '{@link #getDescriptions() Descriptions}' containment reference list.
*
*
* @see #getDescriptions()
* @generated
* @ordered
*/
protected EList descriptions;
/**
*
*
* @generated
*/
protected CheminImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GAMEPackage.Literals.CHEMIN;
}
/**
*
*
* @generated
*/
@Override
public String getLieuIn()
{
return lieuIn;
}
/**
*
*
* @generated
*/
@Override
public void setLieuIn(String newLieuIn)
{
String oldLieuIn = lieuIn;
lieuIn = newLieuIn;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__LIEU_IN, oldLieuIn, lieuIn));
}
/**
*
*
* @generated
*/
@Override
public String getLieuOut()
{
return lieuOut;
}
/**
*
*
* @generated
*/
@Override
public void setLieuOut(String newLieuOut)
{
String oldLieuOut = lieuOut;
lieuOut = newLieuOut;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__LIEU_OUT, oldLieuOut, lieuOut));
}
/**
*
*
* @generated
*/
@Override
public Condition getOuvert()
{
return ouvert;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetOuvert(Condition newOuvert, NotificationChain msgs)
{
Condition oldOuvert = ouvert;
ouvert = newOuvert;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__OUVERT, oldOuvert, newOuvert);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setOuvert(Condition newOuvert)
{
if (newOuvert != ouvert)
{
NotificationChain msgs = null;
if (ouvert != null)
msgs = ((InternalEObject)ouvert).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.CHEMIN__OUVERT, null, msgs);
if (newOuvert != null)
msgs = ((InternalEObject)newOuvert).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.CHEMIN__OUVERT, null, msgs);
msgs = basicSetOuvert(newOuvert, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__OUVERT, newOuvert, newOuvert));
}
/**
*
*
* @generated
*/
@Override
public Condition getVisible()
{
return visible;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetVisible(Condition newVisible, NotificationChain msgs)
{
Condition oldVisible = visible;
visible = newVisible;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__VISIBLE, oldVisible, newVisible);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setVisible(Condition newVisible)
{
if (newVisible != visible)
{
NotificationChain msgs = null;
if (visible != null)
msgs = ((InternalEObject)visible).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.CHEMIN__VISIBLE, null, msgs);
if (newVisible != null)
msgs = ((InternalEObject)newVisible).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.CHEMIN__VISIBLE, null, msgs);
msgs = basicSetVisible(newVisible, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__VISIBLE, newVisible, newVisible));
}
/**
*
*
* @generated
*/
@Override
public Condition getObligatoire()
{
return obligatoire;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetObligatoire(Condition newObligatoire, NotificationChain msgs)
{
Condition oldObligatoire = obligatoire;
obligatoire = newObligatoire;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__OBLIGATOIRE, oldObligatoire, newObligatoire);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setObligatoire(Condition newObligatoire)
{
if (newObligatoire != obligatoire)
{
NotificationChain msgs = null;
if (obligatoire != null)
msgs = ((InternalEObject)obligatoire).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.CHEMIN__OBLIGATOIRE, null, msgs);
if (newObligatoire != null)
msgs = ((InternalEObject)newObligatoire).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.CHEMIN__OBLIGATOIRE, null, msgs);
msgs = basicSetObligatoire(newObligatoire, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.CHEMIN__OBLIGATOIRE, newObligatoire, newObligatoire));
}
/**
*
*
* @generated
*/
@Override
public EList getConnaissances()
{
if (connaissances == null)
{
connaissances = new EDataTypeEList(String.class, this, GAMEPackage.CHEMIN__CONNAISSANCES);
}
return connaissances;
}
/**
*
*
* @generated
*/
@Override
public EList getObjetsRecus()
{
if (objetsRecus == null)
{
objetsRecus = new EDataTypeEList(String.class, this, GAMEPackage.CHEMIN__OBJETS_RECUS);
}
return objetsRecus;
}
/**
*
*
* @generated
*/
@Override
public EList getObjetsConso()
{
if (objetsConso == null)
{
objetsConso = new EDataTypeEList(String.class, this, GAMEPackage.CHEMIN__OBJETS_CONSO);
}
return objetsConso;
}
/**
*
*
* @generated
*/
@Override
public EList getDescriptions()
{
if (descriptions == null)
{
descriptions = new EObjectContainmentEList(Description.class, this, GAMEPackage.CHEMIN__DESCRIPTIONS);
}
return descriptions;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GAMEPackage.CHEMIN__OUVERT:
return basicSetOuvert(null, msgs);
case GAMEPackage.CHEMIN__VISIBLE:
return basicSetVisible(null, msgs);
case GAMEPackage.CHEMIN__OBLIGATOIRE:
return basicSetObligatoire(null, msgs);
case GAMEPackage.CHEMIN__DESCRIPTIONS:
return ((InternalEList>)getDescriptions()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case GAMEPackage.CHEMIN__LIEU_IN:
return getLieuIn();
case GAMEPackage.CHEMIN__LIEU_OUT:
return getLieuOut();
case GAMEPackage.CHEMIN__OUVERT:
return getOuvert();
case GAMEPackage.CHEMIN__VISIBLE:
return getVisible();
case GAMEPackage.CHEMIN__OBLIGATOIRE:
return getObligatoire();
case GAMEPackage.CHEMIN__CONNAISSANCES:
return getConnaissances();
case GAMEPackage.CHEMIN__OBJETS_RECUS:
return getObjetsRecus();
case GAMEPackage.CHEMIN__OBJETS_CONSO:
return getObjetsConso();
case GAMEPackage.CHEMIN__DESCRIPTIONS:
return getDescriptions();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case GAMEPackage.CHEMIN__LIEU_IN:
setLieuIn((String)newValue);
return;
case GAMEPackage.CHEMIN__LIEU_OUT:
setLieuOut((String)newValue);
return;
case GAMEPackage.CHEMIN__OUVERT:
setOuvert((Condition)newValue);
return;
case GAMEPackage.CHEMIN__VISIBLE:
setVisible((Condition)newValue);
return;
case GAMEPackage.CHEMIN__OBLIGATOIRE:
setObligatoire((Condition)newValue);
return;
case GAMEPackage.CHEMIN__CONNAISSANCES:
getConnaissances().clear();
getConnaissances().addAll((Collection extends String>)newValue);
return;
case GAMEPackage.CHEMIN__OBJETS_RECUS:
getObjetsRecus().clear();
getObjetsRecus().addAll((Collection extends String>)newValue);
return;
case GAMEPackage.CHEMIN__OBJETS_CONSO:
getObjetsConso().clear();
getObjetsConso().addAll((Collection extends String>)newValue);
return;
case GAMEPackage.CHEMIN__DESCRIPTIONS:
getDescriptions().clear();
getDescriptions().addAll((Collection extends Description>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GAMEPackage.CHEMIN__LIEU_IN:
setLieuIn(LIEU_IN_EDEFAULT);
return;
case GAMEPackage.CHEMIN__LIEU_OUT:
setLieuOut(LIEU_OUT_EDEFAULT);
return;
case GAMEPackage.CHEMIN__OUVERT:
setOuvert((Condition)null);
return;
case GAMEPackage.CHEMIN__VISIBLE:
setVisible((Condition)null);
return;
case GAMEPackage.CHEMIN__OBLIGATOIRE:
setObligatoire((Condition)null);
return;
case GAMEPackage.CHEMIN__CONNAISSANCES:
getConnaissances().clear();
return;
case GAMEPackage.CHEMIN__OBJETS_RECUS:
getObjetsRecus().clear();
return;
case GAMEPackage.CHEMIN__OBJETS_CONSO:
getObjetsConso().clear();
return;
case GAMEPackage.CHEMIN__DESCRIPTIONS:
getDescriptions().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GAMEPackage.CHEMIN__LIEU_IN:
return LIEU_IN_EDEFAULT == null ? lieuIn != null : !LIEU_IN_EDEFAULT.equals(lieuIn);
case GAMEPackage.CHEMIN__LIEU_OUT:
return LIEU_OUT_EDEFAULT == null ? lieuOut != null : !LIEU_OUT_EDEFAULT.equals(lieuOut);
case GAMEPackage.CHEMIN__OUVERT:
return ouvert != null;
case GAMEPackage.CHEMIN__VISIBLE:
return visible != null;
case GAMEPackage.CHEMIN__OBLIGATOIRE:
return obligatoire != null;
case GAMEPackage.CHEMIN__CONNAISSANCES:
return connaissances != null && !connaissances.isEmpty();
case GAMEPackage.CHEMIN__OBJETS_RECUS:
return objetsRecus != null && !objetsRecus.isEmpty();
case GAMEPackage.CHEMIN__OBJETS_CONSO:
return objetsConso != null && !objetsConso.isEmpty();
case GAMEPackage.CHEMIN__DESCRIPTIONS:
return descriptions != null && !descriptions.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (lieuIn: ");
result.append(lieuIn);
result.append(", lieuOut: ");
result.append(lieuOut);
result.append(", connaissances: ");
result.append(connaissances);
result.append(", objetsRecus: ");
result.append(objetsRecus);
result.append(", objetsConso: ");
result.append(objetsConso);
result.append(')');
return result.toString();
}
} //CheminImpl