/**
* generated by Xtext 2.23.0
*/
package fr.n7.gAME.impl;
import fr.n7.gAME.Condition;
import fr.n7.gAME.Description;
import fr.n7.gAME.GAMEPackage;
import fr.n7.gAME.Lieu;
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 'Lieu'.
*
*
* The following features are implemented:
*
*
* - {@link fr.n7.gAME.impl.LieuImpl#getNom Nom}
* - {@link fr.n7.gAME.impl.LieuImpl#getDeposable Deposable}
* - {@link fr.n7.gAME.impl.LieuImpl#getDepart Depart}
* - {@link fr.n7.gAME.impl.LieuImpl#getFin Fin}
* - {@link fr.n7.gAME.impl.LieuImpl#getPersonnes Personnes}
* - {@link fr.n7.gAME.impl.LieuImpl#getDescriptions Descriptions}
* - {@link fr.n7.gAME.impl.LieuImpl#getObjets Objets}
* - {@link fr.n7.gAME.impl.LieuImpl#getConnaissances Connaissances}
*
*
* @generated
*/
public class LieuImpl extends MinimalEObjectImpl.Container implements Lieu
{
/**
* The default value of the '{@link #getNom() Nom}' attribute.
*
*
* @see #getNom()
* @generated
* @ordered
*/
protected static final String NOM_EDEFAULT = null;
/**
* The cached value of the '{@link #getNom() Nom}' attribute.
*
*
* @see #getNom()
* @generated
* @ordered
*/
protected String nom = NOM_EDEFAULT;
/**
* The cached value of the '{@link #getDeposable() Deposable}' containment reference.
*
*
* @see #getDeposable()
* @generated
* @ordered
*/
protected Condition deposable;
/**
* The cached value of the '{@link #getDepart() Depart}' containment reference.
*
*
* @see #getDepart()
* @generated
* @ordered
*/
protected Condition depart;
/**
* The cached value of the '{@link #getFin() Fin}' containment reference.
*
*
* @see #getFin()
* @generated
* @ordered
*/
protected Condition fin;
/**
* The cached value of the '{@link #getPersonnes() Personnes}' attribute list.
*
*
* @see #getPersonnes()
* @generated
* @ordered
*/
protected EList personnes;
/**
* The cached value of the '{@link #getDescriptions() Descriptions}' containment reference list.
*
*
* @see #getDescriptions()
* @generated
* @ordered
*/
protected EList descriptions;
/**
* The cached value of the '{@link #getObjets() Objets}' attribute list.
*
*
* @see #getObjets()
* @generated
* @ordered
*/
protected EList objets;
/**
* The cached value of the '{@link #getConnaissances() Connaissances}' attribute list.
*
*
* @see #getConnaissances()
* @generated
* @ordered
*/
protected EList connaissances;
/**
*
*
* @generated
*/
protected LieuImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GAMEPackage.Literals.LIEU;
}
/**
*
*
* @generated
*/
@Override
public String getNom()
{
return nom;
}
/**
*
*
* @generated
*/
@Override
public void setNom(String newNom)
{
String oldNom = nom;
nom = newNom;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__NOM, oldNom, nom));
}
/**
*
*
* @generated
*/
@Override
public Condition getDeposable()
{
return deposable;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetDeposable(Condition newDeposable, NotificationChain msgs)
{
Condition oldDeposable = deposable;
deposable = newDeposable;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPOSABLE, oldDeposable, newDeposable);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setDeposable(Condition newDeposable)
{
if (newDeposable != deposable)
{
NotificationChain msgs = null;
if (deposable != null)
msgs = ((InternalEObject)deposable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPOSABLE, null, msgs);
if (newDeposable != null)
msgs = ((InternalEObject)newDeposable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPOSABLE, null, msgs);
msgs = basicSetDeposable(newDeposable, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPOSABLE, newDeposable, newDeposable));
}
/**
*
*
* @generated
*/
@Override
public Condition getDepart()
{
return depart;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetDepart(Condition newDepart, NotificationChain msgs)
{
Condition oldDepart = depart;
depart = newDepart;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPART, oldDepart, newDepart);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setDepart(Condition newDepart)
{
if (newDepart != depart)
{
NotificationChain msgs = null;
if (depart != null)
msgs = ((InternalEObject)depart).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPART, null, msgs);
if (newDepart != null)
msgs = ((InternalEObject)newDepart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__DEPART, null, msgs);
msgs = basicSetDepart(newDepart, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__DEPART, newDepart, newDepart));
}
/**
*
*
* @generated
*/
@Override
public Condition getFin()
{
return fin;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetFin(Condition newFin, NotificationChain msgs)
{
Condition oldFin = fin;
fin = newFin;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__FIN, oldFin, newFin);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setFin(Condition newFin)
{
if (newFin != fin)
{
NotificationChain msgs = null;
if (fin != null)
msgs = ((InternalEObject)fin).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__FIN, null, msgs);
if (newFin != null)
msgs = ((InternalEObject)newFin).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GAMEPackage.LIEU__FIN, null, msgs);
msgs = basicSetFin(newFin, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GAMEPackage.LIEU__FIN, newFin, newFin));
}
/**
*
*
* @generated
*/
@Override
public EList getPersonnes()
{
if (personnes == null)
{
personnes = new EDataTypeEList(String.class, this, GAMEPackage.LIEU__PERSONNES);
}
return personnes;
}
/**
*
*
* @generated
*/
@Override
public EList getDescriptions()
{
if (descriptions == null)
{
descriptions = new EObjectContainmentEList(Description.class, this, GAMEPackage.LIEU__DESCRIPTIONS);
}
return descriptions;
}
/**
*
*
* @generated
*/
@Override
public EList getObjets()
{
if (objets == null)
{
objets = new EDataTypeEList(String.class, this, GAMEPackage.LIEU__OBJETS);
}
return objets;
}
/**
*
*
* @generated
*/
@Override
public EList getConnaissances()
{
if (connaissances == null)
{
connaissances = new EDataTypeEList(String.class, this, GAMEPackage.LIEU__CONNAISSANCES);
}
return connaissances;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GAMEPackage.LIEU__DEPOSABLE:
return basicSetDeposable(null, msgs);
case GAMEPackage.LIEU__DEPART:
return basicSetDepart(null, msgs);
case GAMEPackage.LIEU__FIN:
return basicSetFin(null, msgs);
case GAMEPackage.LIEU__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.LIEU__NOM:
return getNom();
case GAMEPackage.LIEU__DEPOSABLE:
return getDeposable();
case GAMEPackage.LIEU__DEPART:
return getDepart();
case GAMEPackage.LIEU__FIN:
return getFin();
case GAMEPackage.LIEU__PERSONNES:
return getPersonnes();
case GAMEPackage.LIEU__DESCRIPTIONS:
return getDescriptions();
case GAMEPackage.LIEU__OBJETS:
return getObjets();
case GAMEPackage.LIEU__CONNAISSANCES:
return getConnaissances();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case GAMEPackage.LIEU__NOM:
setNom((String)newValue);
return;
case GAMEPackage.LIEU__DEPOSABLE:
setDeposable((Condition)newValue);
return;
case GAMEPackage.LIEU__DEPART:
setDepart((Condition)newValue);
return;
case GAMEPackage.LIEU__FIN:
setFin((Condition)newValue);
return;
case GAMEPackage.LIEU__PERSONNES:
getPersonnes().clear();
getPersonnes().addAll((Collection extends String>)newValue);
return;
case GAMEPackage.LIEU__DESCRIPTIONS:
getDescriptions().clear();
getDescriptions().addAll((Collection extends Description>)newValue);
return;
case GAMEPackage.LIEU__OBJETS:
getObjets().clear();
getObjets().addAll((Collection extends String>)newValue);
return;
case GAMEPackage.LIEU__CONNAISSANCES:
getConnaissances().clear();
getConnaissances().addAll((Collection extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GAMEPackage.LIEU__NOM:
setNom(NOM_EDEFAULT);
return;
case GAMEPackage.LIEU__DEPOSABLE:
setDeposable((Condition)null);
return;
case GAMEPackage.LIEU__DEPART:
setDepart((Condition)null);
return;
case GAMEPackage.LIEU__FIN:
setFin((Condition)null);
return;
case GAMEPackage.LIEU__PERSONNES:
getPersonnes().clear();
return;
case GAMEPackage.LIEU__DESCRIPTIONS:
getDescriptions().clear();
return;
case GAMEPackage.LIEU__OBJETS:
getObjets().clear();
return;
case GAMEPackage.LIEU__CONNAISSANCES:
getConnaissances().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GAMEPackage.LIEU__NOM:
return NOM_EDEFAULT == null ? nom != null : !NOM_EDEFAULT.equals(nom);
case GAMEPackage.LIEU__DEPOSABLE:
return deposable != null;
case GAMEPackage.LIEU__DEPART:
return depart != null;
case GAMEPackage.LIEU__FIN:
return fin != null;
case GAMEPackage.LIEU__PERSONNES:
return personnes != null && !personnes.isEmpty();
case GAMEPackage.LIEU__DESCRIPTIONS:
return descriptions != null && !descriptions.isEmpty();
case GAMEPackage.LIEU__OBJETS:
return objets != null && !objets.isEmpty();
case GAMEPackage.LIEU__CONNAISSANCES:
return connaissances != null && !connaissances.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (nom: ");
result.append(nom);
result.append(", personnes: ");
result.append(personnes);
result.append(", objets: ");
result.append(objets);
result.append(", connaissances: ");
result.append(connaissances);
result.append(')');
return result.toString();
}
} //LieuImpl