blob: 64f35e8028d849d2091318c1cd2b3d70e9135fbc [file] [log] [blame]
/**
* Copyright (c) 2020 CEA LIST, Committer Name, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* CEA LIST - Initial API and implementation
* Patrick Tessier (CEA LIST) patrick.tessier@cea.fr
* Gabriel Pedroza (CEA LIST) gabriel.pedroza@cea.fr
*
*/
package org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
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.EObjectResolvingEList;
import org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Pdp4engCommonGDPRPackage;
import org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Processor;
import org.eclipse.uml2.uml.NamedElement;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Processor</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.impl.ProcessorImpl#getProcess <em>Process</em>}</li>
* <li>{@link org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.impl.ProcessorImpl#getBase_NamedElement <em>Base Named Element</em>}</li>
* </ul>
*
* @generated
*/
public class ProcessorImpl extends MinimalEObjectImpl.Container implements Processor {
/**
* The cached value of the '{@link #getProcess() <em>Process</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProcess()
* @generated
* @ordered
*/
protected EList<org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Process> process;
/**
* The cached value of the '{@link #getBase_NamedElement() <em>Base Named Element</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_NamedElement()
* @generated
* @ordered
*/
protected NamedElement base_NamedElement;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProcessorImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Pdp4engCommonGDPRPackage.Literals.PROCESSOR;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Process> getProcess() {
if (process == null) {
process = new EObjectResolvingEList<org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Process>(org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Process.class, this, Pdp4engCommonGDPRPackage.PROCESSOR__PROCESS);
}
return process;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NamedElement getBase_NamedElement() {
if (base_NamedElement != null && base_NamedElement.eIsProxy()) {
InternalEObject oldBase_NamedElement = (InternalEObject)base_NamedElement;
base_NamedElement = (NamedElement)eResolveProxy(oldBase_NamedElement);
if (base_NamedElement != oldBase_NamedElement) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Pdp4engCommonGDPRPackage.PROCESSOR__BASE_NAMED_ELEMENT, oldBase_NamedElement, base_NamedElement));
}
}
return base_NamedElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NamedElement basicGetBase_NamedElement() {
return base_NamedElement;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setBase_NamedElement(NamedElement newBase_NamedElement) {
NamedElement oldBase_NamedElement = base_NamedElement;
base_NamedElement = newBase_NamedElement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Pdp4engCommonGDPRPackage.PROCESSOR__BASE_NAMED_ELEMENT, oldBase_NamedElement, base_NamedElement));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Pdp4engCommonGDPRPackage.PROCESSOR__PROCESS:
return getProcess();
case Pdp4engCommonGDPRPackage.PROCESSOR__BASE_NAMED_ELEMENT:
if (resolve) return getBase_NamedElement();
return basicGetBase_NamedElement();
}
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 Pdp4engCommonGDPRPackage.PROCESSOR__PROCESS:
getProcess().clear();
getProcess().addAll((Collection<? extends org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Process>)newValue);
return;
case Pdp4engCommonGDPRPackage.PROCESSOR__BASE_NAMED_ELEMENT:
setBase_NamedElement((NamedElement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Pdp4engCommonGDPRPackage.PROCESSOR__PROCESS:
getProcess().clear();
return;
case Pdp4engCommonGDPRPackage.PROCESSOR__BASE_NAMED_ELEMENT:
setBase_NamedElement((NamedElement)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Pdp4engCommonGDPRPackage.PROCESSOR__PROCESS:
return process != null && !process.isEmpty();
case Pdp4engCommonGDPRPackage.PROCESSOR__BASE_NAMED_ELEMENT:
return base_NamedElement != null;
}
return super.eIsSet(featureID);
}
} //ProcessorImpl