| /******************************************************************************* |
| * 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 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; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.Code; |
| |
| 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.TestScriptOrigin; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Test Script Origin</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.TestScriptOriginImpl#getIndex <em>Index</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.TestScriptOriginImpl#getProfile <em>Profile</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class TestScriptOriginImpl extends BackboneElementImpl implements TestScriptOrigin { |
| /** |
| * The cached value of the '{@link #getIndex() <em>Index</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIndex() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.Integer index; |
| |
| /** |
| * The cached value of the '{@link #getProfile() <em>Profile</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProfile() |
| * @generated |
| * @ordered |
| */ |
| protected Code profile; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected TestScriptOriginImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getTestScriptOrigin(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.Integer getIndex() { |
| if (index != null && index.eIsProxy()) { |
| InternalEObject oldIndex = (InternalEObject)index; |
| index = (org.eclipse.mdht.uml.fhir.core.datatype.Integer)eResolveProxy(oldIndex); |
| if (index != oldIndex) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.TEST_SCRIPT_ORIGIN__INDEX, oldIndex, index)); |
| } |
| } |
| return index; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.Integer basicGetIndex() { |
| return index; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIndex(org.eclipse.mdht.uml.fhir.core.datatype.Integer newIndex) { |
| org.eclipse.mdht.uml.fhir.core.datatype.Integer oldIndex = index; |
| index = newIndex; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.TEST_SCRIPT_ORIGIN__INDEX, oldIndex, index)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getProfile() { |
| if (profile != null && profile.eIsProxy()) { |
| InternalEObject oldProfile = (InternalEObject)profile; |
| profile = (Code)eResolveProxy(oldProfile); |
| if (profile != oldProfile) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.TEST_SCRIPT_ORIGIN__PROFILE, oldProfile, profile)); |
| } |
| } |
| return profile; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetProfile() { |
| return profile; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProfile(Code newProfile) { |
| Code oldProfile = profile; |
| profile = newProfile; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.TEST_SCRIPT_ORIGIN__PROFILE, oldProfile, profile)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__INDEX: |
| if (resolve) return getIndex(); |
| return basicGetIndex(); |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__PROFILE: |
| if (resolve) return getProfile(); |
| return basicGetProfile(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__INDEX: |
| setIndex((org.eclipse.mdht.uml.fhir.core.datatype.Integer)newValue); |
| return; |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__PROFILE: |
| setProfile((Code)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__INDEX: |
| setIndex((org.eclipse.mdht.uml.fhir.core.datatype.Integer)null); |
| return; |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__PROFILE: |
| setProfile((Code)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__INDEX: |
| return index != null; |
| case FhirResourcePackage.TEST_SCRIPT_ORIGIN__PROFILE: |
| return profile != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //TestScriptOriginImpl |