blob: 4d24b15f728a2b9aad15eb975853b80ce0755a1f [file] [log] [blame]
/**
* Copyright (c) 2017 CEA LIST.
*
* 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:
* Maged Elaasar - Initial API and implementation
*
*
*/
package org.eclipse.papyrus.infra.core.architecture.cdo;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.papyrus.infra.core.architecture.ArchitectureDomain;
import org.eclipse.papyrus.infra.core.architecture.ArchitecturePackage;
import org.eclipse.papyrus.infra.core.architecture.Concern;
import org.eclipse.papyrus.infra.core.architecture.impl.ADElementImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Concern</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.infra.core.architecture.cdo.ConcernImpl#getDomain <em>Domain</em>}</li>
* </ul>
*
* @generated
*/
public class ConcernImpl extends ADElementImpl implements Concern {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ConcernImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ArchitecturePackage.Literals.CONCERN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ArchitectureDomain getDomain() {
return (ArchitectureDomain)eDynamicGet(ArchitecturePackage.CONCERN__DOMAIN, ArchitecturePackage.Literals.CONCERN__DOMAIN, true, true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDomain(ArchitectureDomain newDomain, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newDomain, ArchitecturePackage.CONCERN__DOMAIN, msgs);
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setDomain(ArchitectureDomain newDomain) {
eDynamicSet(ArchitecturePackage.CONCERN__DOMAIN, ArchitecturePackage.Literals.CONCERN__DOMAIN, newDomain);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.CONCERN__DOMAIN:
if (eInternalContainer() != null) {
msgs = eBasicRemoveFromContainer(msgs);
}
return basicSetDomain((ArchitectureDomain)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.CONCERN__DOMAIN:
return basicSetDomain(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case ArchitecturePackage.CONCERN__DOMAIN:
return eInternalContainer().eInverseRemove(this, ArchitecturePackage.ARCHITECTURE_DOMAIN__CONCERNS, ArchitectureDomain.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ArchitecturePackage.CONCERN__DOMAIN:
return getDomain();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ArchitecturePackage.CONCERN__DOMAIN:
setDomain((ArchitectureDomain)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ArchitecturePackage.CONCERN__DOMAIN:
setDomain((ArchitectureDomain)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ArchitecturePackage.CONCERN__DOMAIN:
return getDomain() != null;
}
return super.eIsSet(featureID);
}
} //ConcernImpl