/**
*/
package de.hub.emfcompress.emffrag.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import de.hub.emfcompress.ObjectDelta;
import de.hub.emfcompress.OriginalObjectReference;
import de.hub.emfcompress.emffrag.meta.EmfCompressPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Original Object Reference</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link de.hub.emfcompress.emffrag.impl.OriginalObjectReferenceImpl#getOriginalObject <em>Original Object</em>}</li>
* </ul>
*
* @generated
*/
public class OriginalObjectReferenceImpl extends ObjectReferenceImpl implements OriginalObjectReference {
/**
* The cached value of the '{@link #getOriginalObject() <em>Original Object</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOriginalObject()
* @generated
* @ordered
*/
protected ObjectDelta originalObject;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected OriginalObjectReferenceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EmfCompressPackage.Literals.ORIGINAL_OBJECT_REFERENCE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ObjectDelta getOriginalObject() {
if (originalObject != null && ((EObject)originalObject).eIsProxy()) {
InternalEObject oldOriginalObject = (InternalEObject)originalObject;
originalObject = (ObjectDelta)eResolveProxy(oldOriginalObject);
if (originalObject != oldOriginalObject) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EmfCompressPackage.ORIGINAL_OBJECT_REFERENCE__ORIGINAL_OBJECT, oldOriginalObject, originalObject));
}
}
return originalObject;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ObjectDelta basicGetOriginalObject() {
return originalObject;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOriginalObject(ObjectDelta newOriginalObject) {
ObjectDelta oldOriginalObject = originalObject;
originalObject = newOriginalObject;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EmfCompressPackage.ORIGINAL_OBJECT_REFERENCE__ORIGINAL_OBJECT, oldOriginalObject, originalObject));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EmfCompressPackage.ORIGINAL_OBJECT_REFERENCE__ORIGINAL_OBJECT:
if (resolve) return getOriginalObject();
return basicGetOriginalObject();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EmfCompressPackage.ORIGINAL_OBJECT_REFERENCE__ORIGINAL_OBJECT:
setOriginalObject((ObjectDelta)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EmfCompressPackage.ORIGINAL_OBJECT_REFERENCE__ORIGINAL_OBJECT:
setOriginalObject((ObjectDelta)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EmfCompressPackage.ORIGINAL_OBJECT_REFERENCE__ORIGINAL_OBJECT:
return originalObject != null;
}
return super.eIsSet(featureID);
}
} //OriginalObjectReferenceImpl