| /******************************************************************************* |
| * 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.Uri; |
| |
| 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.ValueSetCodeSystem; |
| import org.eclipse.mdht.uml.fhir.core.resource.ValueSetCodeSystemConceptDefinition; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Value Set Code System</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetCodeSystemImpl#getSystem <em>System</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetCodeSystemImpl#getVersion <em>Version</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetCodeSystemImpl#getCaseSensitive <em>Case Sensitive</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetCodeSystemImpl#getConcepts <em>Concept</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ValueSetCodeSystemImpl extends BackboneElementImpl implements ValueSetCodeSystem { |
| /** |
| * The cached value of the '{@link #getSystem() <em>System</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSystem() |
| * @generated |
| * @ordered |
| */ |
| protected Uri system; |
| |
| /** |
| * The cached value of the '{@link #getVersion() <em>Version</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVersion() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String version; |
| |
| /** |
| * The cached value of the '{@link #getCaseSensitive() <em>Case Sensitive</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCaseSensitive() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.Boolean caseSensitive; |
| |
| /** |
| * The cached value of the '{@link #getConcepts() <em>Concept</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getConcepts() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ValueSetCodeSystemConceptDefinition> concepts; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ValueSetCodeSystemImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getValueSetCodeSystem(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getSystem() { |
| if (system != null && system.eIsProxy()) { |
| InternalEObject oldSystem = (InternalEObject)system; |
| system = (Uri)eResolveProxy(oldSystem); |
| if (system != oldSystem) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.VALUE_SET_CODE_SYSTEM__SYSTEM, oldSystem, system)); |
| } |
| } |
| return system; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri basicGetSystem() { |
| return system; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSystem(Uri newSystem) { |
| Uri oldSystem = system; |
| system = newSystem; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.VALUE_SET_CODE_SYSTEM__SYSTEM, oldSystem, system)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getVersion() { |
| if (version != null && version.eIsProxy()) { |
| InternalEObject oldVersion = (InternalEObject)version; |
| version = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldVersion); |
| if (version != oldVersion) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.VALUE_SET_CODE_SYSTEM__VERSION, oldVersion, version)); |
| } |
| } |
| return version; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetVersion() { |
| return version; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setVersion(org.eclipse.mdht.uml.fhir.core.datatype.String newVersion) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldVersion = version; |
| version = newVersion; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.VALUE_SET_CODE_SYSTEM__VERSION, oldVersion, version)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.Boolean getCaseSensitive() { |
| if (caseSensitive != null && caseSensitive.eIsProxy()) { |
| InternalEObject oldCaseSensitive = (InternalEObject)caseSensitive; |
| caseSensitive = (org.eclipse.mdht.uml.fhir.core.datatype.Boolean)eResolveProxy(oldCaseSensitive); |
| if (caseSensitive != oldCaseSensitive) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CASE_SENSITIVE, oldCaseSensitive, caseSensitive)); |
| } |
| } |
| return caseSensitive; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.Boolean basicGetCaseSensitive() { |
| return caseSensitive; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCaseSensitive(org.eclipse.mdht.uml.fhir.core.datatype.Boolean newCaseSensitive) { |
| org.eclipse.mdht.uml.fhir.core.datatype.Boolean oldCaseSensitive = caseSensitive; |
| caseSensitive = newCaseSensitive; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CASE_SENSITIVE, oldCaseSensitive, caseSensitive)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ValueSetCodeSystemConceptDefinition> getConcepts() { |
| if (concepts == null) { |
| concepts = new EObjectContainmentEList<ValueSetCodeSystemConceptDefinition>(ValueSetCodeSystemConceptDefinition.class, this, FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CONCEPT); |
| } |
| return concepts; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CONCEPT: |
| return ((InternalEList<?>)getConcepts()).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.VALUE_SET_CODE_SYSTEM__SYSTEM: |
| if (resolve) return getSystem(); |
| return basicGetSystem(); |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__VERSION: |
| if (resolve) return getVersion(); |
| return basicGetVersion(); |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CASE_SENSITIVE: |
| if (resolve) return getCaseSensitive(); |
| return basicGetCaseSensitive(); |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CONCEPT: |
| return getConcepts(); |
| } |
| 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.VALUE_SET_CODE_SYSTEM__SYSTEM: |
| setSystem((Uri)newValue); |
| return; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__VERSION: |
| setVersion((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CASE_SENSITIVE: |
| setCaseSensitive((org.eclipse.mdht.uml.fhir.core.datatype.Boolean)newValue); |
| return; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CONCEPT: |
| getConcepts().clear(); |
| getConcepts().addAll((Collection<? extends ValueSetCodeSystemConceptDefinition>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__SYSTEM: |
| setSystem((Uri)null); |
| return; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__VERSION: |
| setVersion((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CASE_SENSITIVE: |
| setCaseSensitive((org.eclipse.mdht.uml.fhir.core.datatype.Boolean)null); |
| return; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CONCEPT: |
| getConcepts().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__SYSTEM: |
| return system != null; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__VERSION: |
| return version != null; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CASE_SENSITIVE: |
| return caseSensitive != null; |
| case FhirResourcePackage.VALUE_SET_CODE_SYSTEM__CONCEPT: |
| return concepts != null && !concepts.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ValueSetCodeSystemImpl |