org.openhealthtools.mdht.uml.cda.impl.SDTCPatientImpl Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2009, 2011 IBM Corporation and others.
* 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
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.openhealthtools.mdht.uml.cda.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.emf.ecore.impl.EObjectImpl;
import org.openhealthtools.mdht.uml.cda.CDAPackage;
import org.openhealthtools.mdht.uml.cda.SDTCPatient;
import org.openhealthtools.mdht.uml.hl7.datatypes.II;
/**
*
* An implementation of the model object 'SDTC Patient'.
*
*
* The following features are implemented:
*
* - {@link org.openhealthtools.mdht.uml.cda.impl.SDTCPatientImpl#getId Id}
*
*
*
* @generated
*/
public class SDTCPatientImpl extends EObjectImpl implements SDTCPatient {
/**
* The cached value of the '{@link #getId() Id}' containment reference.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected II id;
/**
*
*
* @generated
*/
protected SDTCPatientImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CDAPackage.Literals.SDTC_PATIENT;
}
/**
*
*
* @generated
*/
public II getId() {
return id;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetId(II newId, NotificationChain msgs) {
II oldId = id;
id = newId;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(
this, Notification.SET, CDAPackage.SDTC_PATIENT__ID, oldId, newId);
if (msgs == null) {
msgs = notification;
} else {
msgs.add(notification);
}
}
return msgs;
}
/**
*
*
* @generated
*/
public void setId(II newId) {
if (newId != id) {
NotificationChain msgs = null;
if (id != null) {
msgs = ((InternalEObject) id).eInverseRemove(
this, EOPPOSITE_FEATURE_BASE - CDAPackage.SDTC_PATIENT__ID, null, msgs);
}
if (newId != null) {
msgs = ((InternalEObject) newId).eInverseAdd(
this, EOPPOSITE_FEATURE_BASE - CDAPackage.SDTC_PATIENT__ID, null, msgs);
}
msgs = basicSetId(newId, msgs);
if (msgs != null) {
msgs.dispatch();
}
} else if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, CDAPackage.SDTC_PATIENT__ID, newId, newId));
}
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case CDAPackage.SDTC_PATIENT__ID:
return basicSetId(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CDAPackage.SDTC_PATIENT__ID:
return getId();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CDAPackage.SDTC_PATIENT__ID:
setId((II) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CDAPackage.SDTC_PATIENT__ID:
setId((II) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CDAPackage.SDTC_PATIENT__ID:
return id != null;
}
return super.eIsSet(featureID);
}
} // SDTCPatientImpl