blob: 7b84c60d7ec1f89c10fab5b0d252bff5e9581a13 [file] [log] [blame]
/**
* Copyright (c) 2010, 2012 Ericsson
*
* 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
*
* Description:
*
* Contributors:
* Alvaro Sanchez-Leon - Initial API and implementation
*
*/
package org.eclipse.mylyn.reviews.r4e.core.model.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.mylyn.reviews.r4e.core.model.R4EID;
import org.eclipse.mylyn.reviews.r4e.core.model.R4EIDComponent;
import org.eclipse.mylyn.reviews.r4e.core.model.RModelPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>R4EID Component</b></em>'. <!-- end-user-doc
* -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.mylyn.reviews.r4e.core.model.impl.R4EIDComponentImpl#getId <em>Id</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class R4EIDComponentImpl extends R4EReviewComponentImpl implements R4EIDComponent {
/**
* The cached value of the '{@link #getId() <em>Id</em>}' containment reference.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected R4EID id;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected R4EIDComponentImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RModelPackage.Literals.R4EID_COMPONENT;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public R4EID getId() {
if (id != null && id.eIsProxy()) {
InternalEObject oldId = (InternalEObject)id;
id = (R4EID)eResolveProxy(oldId);
if (id != oldId) {
InternalEObject newId = (InternalEObject)id;
NotificationChain msgs = oldId.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RModelPackage.R4EID_COMPONENT__ID, null, null);
if (newId.eInternalContainer() == null) {
msgs = newId.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RModelPackage.R4EID_COMPONENT__ID, null, msgs);
}
if (msgs != null) msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, RModelPackage.R4EID_COMPONENT__ID, oldId, id));
}
}
return id;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public R4EID basicGetId() {
return id;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetId(R4EID newId, NotificationChain msgs) {
R4EID oldId = id;
id = newId;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RModelPackage.R4EID_COMPONENT__ID, oldId, newId);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setId(R4EID newId) {
if (newId != id) {
NotificationChain msgs = null;
if (id != null)
msgs = ((InternalEObject)id).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RModelPackage.R4EID_COMPONENT__ID, null, msgs);
if (newId != null)
msgs = ((InternalEObject)newId).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RModelPackage.R4EID_COMPONENT__ID, null, msgs);
msgs = basicSetId(newId, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RModelPackage.R4EID_COMPONENT__ID, newId, newId));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RModelPackage.R4EID_COMPONENT__ID:
return basicSetId(null, 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 RModelPackage.R4EID_COMPONENT__ID:
if (resolve) return getId();
return basicGetId();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RModelPackage.R4EID_COMPONENT__ID:
setId((R4EID)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RModelPackage.R4EID_COMPONENT__ID:
setId((R4EID)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RModelPackage.R4EID_COMPONENT__ID:
return id != null;
}
return super.eIsSet(featureID);
}
} //R4EIDComponentImpl