blob: 865e2a81c09ddd6ab4b5e7f0e2e3e9679e7f4614 [file] [log] [blame]
/**
* Copyright (c) 2012 Obeo.
* 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:
* Obeo - initial API and implementation
*/
package org.eclipse.emf.compare.uml2.internal.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.compare.uml2.internal.ProfileApplicationChange;
import org.eclipse.emf.compare.uml2.internal.UMLComparePackage;
import org.eclipse.emf.compare.uml2.internal.spec.UMLDiffSpec;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.uml2.uml.Profile;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Profile Application Change</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.compare.uml2.internal.impl.ProfileApplicationChangeImpl#getProfile <em>Profile</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ProfileApplicationChangeImpl extends UMLDiffSpec implements ProfileApplicationChange {
/**
* The cached value of the '{@link #getProfile() <em>Profile</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProfile()
* @generated
* @ordered
*/
protected Profile profile;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected ProfileApplicationChangeImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UMLComparePackage.Literals.PROFILE_APPLICATION_CHANGE;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public Profile getProfile() {
if (profile != null && profile.eIsProxy()) {
InternalEObject oldProfile = (InternalEObject)profile;
profile = (Profile)eResolveProxy(oldProfile);
if (profile != oldProfile) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
UMLComparePackage.PROFILE_APPLICATION_CHANGE__PROFILE, oldProfile, profile));
}
}
return profile;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public Profile basicGetProfile() {
return profile;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setProfile(Profile newProfile) {
Profile oldProfile = profile;
profile = newProfile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLComparePackage.PROFILE_APPLICATION_CHANGE__PROFILE, oldProfile, profile));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UMLComparePackage.PROFILE_APPLICATION_CHANGE__PROFILE:
if (resolve)
return getProfile();
return basicGetProfile();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UMLComparePackage.PROFILE_APPLICATION_CHANGE__PROFILE:
setProfile((Profile)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UMLComparePackage.PROFILE_APPLICATION_CHANGE__PROFILE:
setProfile((Profile)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UMLComparePackage.PROFILE_APPLICATION_CHANGE__PROFILE:
return profile != null;
}
return super.eIsSet(featureID);
}
} // ProfileApplicationChangeImpl