blob: b4cd9fc8e17615b90b669d277a8171d2c01580bf [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.allocations.internal.impl;
import org.eclipse.emf.common.notify.Notification;
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.papyrus.sysml.allocations.Allocate;
import org.eclipse.papyrus.sysml.allocations.AllocationsPackage;
import org.eclipse.uml2.uml.Abstraction;
/**
* <!-- begin-user-doc --> An implementation of the model object ' <em><b>Allocate</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.sysml.allocations.internal.impl.AllocateImpl#getBase_Abstraction <em>Base Abstraction</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AllocateImpl extends MinimalEObjectImpl.Container implements Allocate {
/**
* The cached value of the '{@link #getBase_Abstraction() <em>Base Abstraction</em>}' reference.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getBase_Abstraction()
* @generated
* @ordered
*/
protected Abstraction base_Abstraction;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected AllocateImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Abstraction basicGetBase_Abstraction() {
return base_Abstraction;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AllocationsPackage.ALLOCATE__BASE_ABSTRACTION:
if (resolve) {
return getBase_Abstraction();
}
return basicGetBase_Abstraction();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AllocationsPackage.ALLOCATE__BASE_ABSTRACTION:
return base_Abstraction != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AllocationsPackage.ALLOCATE__BASE_ABSTRACTION:
setBase_Abstraction((Abstraction) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return AllocationsPackage.Literals.ALLOCATE;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AllocationsPackage.ALLOCATE__BASE_ABSTRACTION:
setBase_Abstraction((Abstraction) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Abstraction getBase_Abstraction() {
if (base_Abstraction != null && base_Abstraction.eIsProxy()) {
InternalEObject oldBase_Abstraction = (InternalEObject) base_Abstraction;
base_Abstraction = (Abstraction) eResolveProxy(oldBase_Abstraction);
if (base_Abstraction != oldBase_Abstraction) {
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AllocationsPackage.ALLOCATE__BASE_ABSTRACTION, oldBase_Abstraction, base_Abstraction));
}
}
}
return base_Abstraction;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setBase_Abstraction(Abstraction newBase_Abstraction) {
Abstraction oldBase_Abstraction = base_Abstraction;
base_Abstraction = newBase_Abstraction;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, AllocationsPackage.ALLOCATE__BASE_ABSTRACTION, oldBase_Abstraction, base_Abstraction));
}
}
} // AllocateImpl