projet-genie-logiciel-systeme/workspace/fr.n7.game/src-gen/fr/n7/gAME/impl/CheminImpl.java
Laurent Fainsin dbbc56c241 save: tmp
2021-12-03 09:38:29 +01:00

641 lines
17 KiB
Java

/**
* 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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Chemin</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getLieuIn <em>Lieu In</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getLieuOut <em>Lieu Out</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getOuvert <em>Ouvert</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getVisible <em>Visible</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getObligatoire <em>Obligatoire</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getConnaissances <em>Connaissances</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getObjetsRecus <em>Objets Recus</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getObjetsConso <em>Objets Conso</em>}</li>
* <li>{@link fr.n7.gAME.impl.CheminImpl#getDescriptions <em>Descriptions</em>}</li>
* </ul>
*
* @generated
*/
public class CheminImpl extends MinimalEObjectImpl.Container implements Chemin
{
/**
* The default value of the '{@link #getLieuIn() <em>Lieu In</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLieuIn()
* @generated
* @ordered
*/
protected static final String LIEU_IN_EDEFAULT = null;
/**
* The cached value of the '{@link #getLieuIn() <em>Lieu In</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLieuIn()
* @generated
* @ordered
*/
protected String lieuIn = LIEU_IN_EDEFAULT;
/**
* The default value of the '{@link #getLieuOut() <em>Lieu Out</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLieuOut()
* @generated
* @ordered
*/
protected static final String LIEU_OUT_EDEFAULT = null;
/**
* The cached value of the '{@link #getLieuOut() <em>Lieu Out</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLieuOut()
* @generated
* @ordered
*/
protected String lieuOut = LIEU_OUT_EDEFAULT;
/**
* The cached value of the '{@link #getOuvert() <em>Ouvert</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOuvert()
* @generated
* @ordered
*/
protected Condition ouvert;
/**
* The cached value of the '{@link #getVisible() <em>Visible</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVisible()
* @generated
* @ordered
*/
protected Condition visible;
/**
* The cached value of the '{@link #getObligatoire() <em>Obligatoire</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObligatoire()
* @generated
* @ordered
*/
protected Condition obligatoire;
/**
* The cached value of the '{@link #getConnaissances() <em>Connaissances</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConnaissances()
* @generated
* @ordered
*/
protected EList<String> connaissances;
/**
* The cached value of the '{@link #getObjetsRecus() <em>Objets Recus</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjetsRecus()
* @generated
* @ordered
*/
protected EList<String> objetsRecus;
/**
* The cached value of the '{@link #getObjetsConso() <em>Objets Conso</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjetsConso()
* @generated
* @ordered
*/
protected EList<String> objetsConso;
/**
* The cached value of the '{@link #getDescriptions() <em>Descriptions</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescriptions()
* @generated
* @ordered
*/
protected EList<Description> descriptions;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CheminImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GAMEPackage.Literals.CHEMIN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getLieuIn()
{
return lieuIn;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getLieuOut()
{
return lieuOut;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getOuvert()
{
return ouvert;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getVisible()
{
return visible;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Condition getObligatoire()
{
return obligatoire;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getConnaissances()
{
if (connaissances == null)
{
connaissances = new EDataTypeEList<String>(String.class, this, GAMEPackage.CHEMIN__CONNAISSANCES);
}
return connaissances;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getObjetsRecus()
{
if (objetsRecus == null)
{
objetsRecus = new EDataTypeEList<String>(String.class, this, GAMEPackage.CHEMIN__OBJETS_RECUS);
}
return objetsRecus;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<String> getObjetsConso()
{
if (objetsConso == null)
{
objetsConso = new EDataTypeEList<String>(String.class, this, GAMEPackage.CHEMIN__OBJETS_CONSO);
}
return objetsConso;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Description> getDescriptions()
{
if (descriptions == null)
{
descriptions = new EObjectContainmentEList<Description>(Description.class, this, GAMEPackage.CHEMIN__DESCRIPTIONS);
}
return descriptions;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @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