blob: 59b69f0fc56c5f2ce185d2c3507ef9a2994a2274 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016 David Carlson 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:
* David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation
*******************************************************************************/
/**
*/
package org.eclipse.mdht.uml.fhir.core.resource.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
import org.eclipse.mdht.uml.fhir.core.resource.ImplementationGuidePackage;
import org.eclipse.mdht.uml.fhir.core.resource.ImplementationGuidePackageResource;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Implementation Guide Package</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePackageImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePackageImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuidePackageImpl#getResources <em>Resource</em>}</li>
* </ul>
*
* @generated
*/
public class ImplementationGuidePackageImpl extends BackboneElementImpl implements ImplementationGuidePackage {
/**
* The cached value of the '{@link #getName() <em>Name</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String name;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String description;
/**
* The cached value of the '{@link #getResources() <em>Resource</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResources()
* @generated
* @ordered
*/
protected EList<ImplementationGuidePackageResource> resources;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ImplementationGuidePackageImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getImplementationGuidePackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getName() {
if (name != null && name.eIsProxy()) {
InternalEObject oldName = (InternalEObject)name;
name = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldName);
if (name != oldName) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__NAME, oldName, name));
}
}
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(org.eclipse.mdht.uml.fhir.core.datatype.String newName) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getDescription() {
if (description != null && description.eIsProxy()) {
InternalEObject oldDescription = (InternalEObject)description;
description = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldDescription);
if (description != oldDescription) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__DESCRIPTION, oldDescription, description));
}
}
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(org.eclipse.mdht.uml.fhir.core.datatype.String newDescription) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__DESCRIPTION, oldDescription, description));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ImplementationGuidePackageResource> getResources() {
if (resources == null) {
resources = new EObjectContainmentEList<ImplementationGuidePackageResource>(ImplementationGuidePackageResource.class, this, FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__RESOURCE);
}
return resources;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__RESOURCE:
return ((InternalEList<?>)getResources()).basicRemove(otherEnd, 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 FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__NAME:
if (resolve) return getName();
return basicGetName();
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__DESCRIPTION:
if (resolve) return getDescription();
return basicGetDescription();
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__RESOURCE:
return getResources();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__NAME:
setName((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__DESCRIPTION:
setDescription((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__RESOURCE:
getResources().clear();
getResources().addAll((Collection<? extends ImplementationGuidePackageResource>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__NAME:
setName((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__DESCRIPTION:
setDescription((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__RESOURCE:
getResources().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__NAME:
return name != null;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__DESCRIPTION:
return description != null;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_PACKAGE__RESOURCE:
return resources != null && !resources.isEmpty();
}
return super.eIsSet(featureID);
}
} //ImplementationGuidePackageImpl