244 lines
5.5 KiB
Java
244 lines
5.5 KiB
Java
/**
|
|
* generated by Xtext 2.23.0
|
|
*/
|
|
package fr.n7.pDL1.impl;
|
|
|
|
import fr.n7.pDL1.PDL1Package;
|
|
import fr.n7.pDL1.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.pDL1.impl.ProcessImpl#getName <em>Name</em>}</li>
|
|
* <li>{@link fr.n7.pDL1.impl.ProcessImpl#getProcessElements <em>Process Elements</em>}</li>
|
|
* </ul>
|
|
*
|
|
* @generated
|
|
*/
|
|
public class ProcessImpl extends MinimalEObjectImpl.Container implements fr.n7.pDL1.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 PDL1Package.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, PDL1Package.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, PDL1Package.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 PDL1Package.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 PDL1Package.PROCESS__NAME:
|
|
return getName();
|
|
case PDL1Package.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 PDL1Package.PROCESS__NAME:
|
|
setName((String)newValue);
|
|
return;
|
|
case PDL1Package.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 PDL1Package.PROCESS__NAME:
|
|
setName(NAME_EDEFAULT);
|
|
return;
|
|
case PDL1Package.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 PDL1Package.PROCESS__NAME:
|
|
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
|
case PDL1Package.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
|