blob: 664d547509a90d26639b7465c1f48f3cc246e19f [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.FhirPackage;
import org.hl7.fhir.Narrative;
import org.hl7.fhir.NarrativeStatus;
import org.w3._1999.xhtml.DivType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Narrative</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.NarrativeImpl#getStatus <em>Status</em>}</li>
* <li>{@link org.hl7.fhir.impl.NarrativeImpl#getDiv <em>Div</em>}</li>
* </ul>
*
* @generated
*/
public class NarrativeImpl extends ElementImpl implements Narrative {
/**
* The cached value of the '{@link #getStatus() <em>Status</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStatus()
* @generated
* @ordered
*/
protected NarrativeStatus status;
/**
* The cached value of the '{@link #getDiv() <em>Div</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDiv()
* @generated
* @ordered
*/
protected DivType div;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected NarrativeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getNarrative();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NarrativeStatus getStatus() {
return status;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStatus(NarrativeStatus newStatus, NotificationChain msgs) {
NarrativeStatus oldStatus = status;
status = newStatus;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.NARRATIVE__STATUS, oldStatus, newStatus);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStatus(NarrativeStatus newStatus) {
if (newStatus != status) {
NotificationChain msgs = null;
if (status != null)
msgs = ((InternalEObject)status).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.NARRATIVE__STATUS, null, msgs);
if (newStatus != null)
msgs = ((InternalEObject)newStatus).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.NARRATIVE__STATUS, null, msgs);
msgs = basicSetStatus(newStatus, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.NARRATIVE__STATUS, newStatus, newStatus));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DivType getDiv() {
return div;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDiv(DivType newDiv, NotificationChain msgs) {
DivType oldDiv = div;
div = newDiv;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.NARRATIVE__DIV, oldDiv, newDiv);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDiv(DivType newDiv) {
if (newDiv != div) {
NotificationChain msgs = null;
if (div != null)
msgs = ((InternalEObject)div).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.NARRATIVE__DIV, null, msgs);
if (newDiv != null)
msgs = ((InternalEObject)newDiv).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.NARRATIVE__DIV, null, msgs);
msgs = basicSetDiv(newDiv, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.NARRATIVE__DIV, newDiv, newDiv));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.NARRATIVE__STATUS:
return basicSetStatus(null, msgs);
case FhirPackage.NARRATIVE__DIV:
return basicSetDiv(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.NARRATIVE__STATUS:
return getStatus();
case FhirPackage.NARRATIVE__DIV:
return getDiv();
}
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.NARRATIVE__STATUS:
setStatus((NarrativeStatus)newValue);
return;
case FhirPackage.NARRATIVE__DIV:
setDiv((DivType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.NARRATIVE__STATUS:
setStatus((NarrativeStatus)null);
return;
case FhirPackage.NARRATIVE__DIV:
setDiv((DivType)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.NARRATIVE__STATUS:
return status != null;
case FhirPackage.NARRATIVE__DIV:
return div != null;
}
return super.eIsSet(featureID);
}
} //NarrativeImpl