/**
* Copyright (c) 2011 Object Management Group (SAEM metamodel)
* Copyright (c) 2010-2011 United States Government as represented by the Administrator for The National Aeronautics and Space Administration. All Rights Reserved.
*/
package net.certware.evidence.evidence.impl;
import net.certware.evidence.evidence.ApprovedBy;
import net.certware.evidence.evidence.EvidencePackage;
import net.certware.evidence.evidence.Originator;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Approved By</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link net.certware.evidence.evidence.impl.ApprovedByImpl#getSupervisor <em>Supervisor</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ApprovedByImpl extends ProvenanceImpl implements ApprovedBy {
/**
* The cached value of the '{@link #getSupervisor() <em>Supervisor</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSupervisor()
* @generated
* @ordered
*/
protected Originator supervisor;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ApprovedByImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EvidencePackage.Literals.APPROVED_BY;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Originator getSupervisor() {
if (supervisor != null && supervisor.eIsProxy()) {
InternalEObject oldSupervisor = (InternalEObject)supervisor;
supervisor = (Originator)eResolveProxy(oldSupervisor);
if (supervisor != oldSupervisor) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EvidencePackage.APPROVED_BY__SUPERVISOR, oldSupervisor, supervisor));
}
}
return supervisor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Originator basicGetSupervisor() {
return supervisor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSupervisor(Originator newSupervisor) {
Originator oldSupervisor = supervisor;
supervisor = newSupervisor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EvidencePackage.APPROVED_BY__SUPERVISOR, oldSupervisor, supervisor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EvidencePackage.APPROVED_BY__SUPERVISOR:
if (resolve) return getSupervisor();
return basicGetSupervisor();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EvidencePackage.APPROVED_BY__SUPERVISOR:
setSupervisor((Originator)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EvidencePackage.APPROVED_BY__SUPERVISOR:
setSupervisor((Originator)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EvidencePackage.APPROVED_BY__SUPERVISOR:
return supervisor != null;
}
return super.eIsSet(featureID);
}
} //ApprovedByImpl