projet-mini-genie-logiciel-.../eclipse-workspace/fr.n7.pdl2/src-gen/fr/n7/pDL2/impl/ProcessImpl.java
Laurent Fainsin de42fac315 TP7
2021-10-12 18:49:13 +02:00

244 lines
5.5 KiB
Java

/**
* generated by Xtext 2.23.0
*/
package fr.n7.pDL2.impl;
import fr.n7.pDL2.PDL2Package;
import fr.n7.pDL2.ProcessElement;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Process</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link fr.n7.pDL2.impl.ProcessImpl#getName <em>Name</em>}</li>
* <li>{@link fr.n7.pDL2.impl.ProcessImpl#getProcessElements <em>Process Elements</em>}</li>
* </ul>
*
* @generated
*/
public class ProcessImpl extends MinimalEObjectImpl.Container implements fr.n7.pDL2.Process
{
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getProcessElements() <em>Process Elements</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProcessElements()
* @generated
* @ordered
*/
protected EList<ProcessElement> processElements;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProcessImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return PDL2Package.Literals.PROCESS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PDL2Package.PROCESS__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<ProcessElement> getProcessElements()
{
if (processElements == null)
{
processElements = new EObjectContainmentEList<ProcessElement>(ProcessElement.class, this, PDL2Package.PROCESS__PROCESS_ELEMENTS);
}
return processElements;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case PDL2Package.PROCESS__PROCESS_ELEMENTS:
return ((InternalEList<?>)getProcessElements()).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 PDL2Package.PROCESS__NAME:
return getName();
case PDL2Package.PROCESS__PROCESS_ELEMENTS:
return getProcessElements();
}
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 PDL2Package.PROCESS__NAME:
setName((String)newValue);
return;
case PDL2Package.PROCESS__PROCESS_ELEMENTS:
getProcessElements().clear();
getProcessElements().addAll((Collection<? extends ProcessElement>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case PDL2Package.PROCESS__NAME:
setName(NAME_EDEFAULT);
return;
case PDL2Package.PROCESS__PROCESS_ELEMENTS:
getProcessElements().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case PDL2Package.PROCESS__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case PDL2Package.PROCESS__PROCESS_ELEMENTS:
return processElements != null && !processElements.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(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //ProcessImpl