blob: bf67b96e75fe50a5778276b2e03f554e17207372 [file] [log] [blame]
/**
*/
package org.hl7.fhir.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.hl7.fhir.CodeableConcept;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.ProcedureFocalDevice;
import org.hl7.fhir.Reference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Procedure Focal Device</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ProcedureFocalDeviceImpl#getAction <em>Action</em>}</li>
* <li>{@link org.hl7.fhir.impl.ProcedureFocalDeviceImpl#getManipulated <em>Manipulated</em>}</li>
* </ul>
*
* @generated
*/
public class ProcedureFocalDeviceImpl extends BackboneElementImpl implements ProcedureFocalDevice {
/**
* The cached value of the '{@link #getAction() <em>Action</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAction()
* @generated
* @ordered
*/
protected CodeableConcept action;
/**
* The cached value of the '{@link #getManipulated() <em>Manipulated</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getManipulated()
* @generated
* @ordered
*/
protected Reference manipulated;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProcedureFocalDeviceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getProcedureFocalDevice();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getAction() {
return action;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAction(CodeableConcept newAction, NotificationChain msgs) {
CodeableConcept oldAction = action;
action = newAction;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION, oldAction, newAction);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAction(CodeableConcept newAction) {
if (newAction != action) {
NotificationChain msgs = null;
if (action != null)
msgs = ((InternalEObject)action).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION, null, msgs);
if (newAction != null)
msgs = ((InternalEObject)newAction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION, null, msgs);
msgs = basicSetAction(newAction, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION, newAction, newAction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Reference getManipulated() {
return manipulated;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetManipulated(Reference newManipulated, NotificationChain msgs) {
Reference oldManipulated = manipulated;
manipulated = newManipulated;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED, oldManipulated, newManipulated);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setManipulated(Reference newManipulated) {
if (newManipulated != manipulated) {
NotificationChain msgs = null;
if (manipulated != null)
msgs = ((InternalEObject)manipulated).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED, null, msgs);
if (newManipulated != null)
msgs = ((InternalEObject)newManipulated).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED, null, msgs);
msgs = basicSetManipulated(newManipulated, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED, newManipulated, newManipulated));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION:
return basicSetAction(null, msgs);
case FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED:
return basicSetManipulated(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 FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION:
return getAction();
case FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED:
return getManipulated();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION:
setAction((CodeableConcept)newValue);
return;
case FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED:
setManipulated((Reference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION:
setAction((CodeableConcept)null);
return;
case FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED:
setManipulated((Reference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.PROCEDURE_FOCAL_DEVICE__ACTION:
return action != null;
case FhirPackage.PROCEDURE_FOCAL_DEVICE__MANIPULATED:
return manipulated != null;
}
return super.eIsSet(featureID);
}
} //ProcedureFocalDeviceImpl