blob: 3002e461c108f1cc45658aa7728fb92093e227c9 [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.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.ValueSetComposeConceptSet;
import org.eclipse.mdht.uml.fhir.core.resource.ValueSetComposeConceptSetConceptReference;
import org.eclipse.mdht.uml.fhir.core.resource.ValueSetComposeConceptSetFilter;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Value Set Compose Concept Set</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetComposeConceptSetImpl#getSystem <em>System</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetComposeConceptSetImpl#getVersion <em>Version</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetComposeConceptSetImpl#getConcepts <em>Concept</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ValueSetComposeConceptSetImpl#getFilters <em>Filter</em>}</li>
* </ul>
*
* @generated
*/
public class ValueSetComposeConceptSetImpl extends BackboneElementImpl implements ValueSetComposeConceptSet {
/**
* 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 #getConcepts() <em>Concept</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConcepts()
* @generated
* @ordered
*/
protected EList<ValueSetComposeConceptSetConceptReference> concepts;
/**
* The cached value of the '{@link #getFilters() <em>Filter</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFilters()
* @generated
* @ordered
*/
protected EList<ValueSetComposeConceptSetFilter> filters;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ValueSetComposeConceptSetImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getValueSetComposeConceptSet();
}
/**
* <!-- 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_COMPOSE_CONCEPT_SET__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_COMPOSE_CONCEPT_SET__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_COMPOSE_CONCEPT_SET__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_COMPOSE_CONCEPT_SET__VERSION, oldVersion, version));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ValueSetComposeConceptSetConceptReference> getConcepts() {
if (concepts == null) {
concepts = new EObjectContainmentEList<ValueSetComposeConceptSetConceptReference>(ValueSetComposeConceptSetConceptReference.class, this, FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__CONCEPT);
}
return concepts;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ValueSetComposeConceptSetFilter> getFilters() {
if (filters == null) {
filters = new EObjectContainmentEList<ValueSetComposeConceptSetFilter>(ValueSetComposeConceptSetFilter.class, this, FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__FILTER);
}
return filters;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__CONCEPT:
return ((InternalEList<?>)getConcepts()).basicRemove(otherEnd, msgs);
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__FILTER:
return ((InternalEList<?>)getFilters()).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_COMPOSE_CONCEPT_SET__SYSTEM:
if (resolve) return getSystem();
return basicGetSystem();
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__VERSION:
if (resolve) return getVersion();
return basicGetVersion();
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__CONCEPT:
return getConcepts();
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__FILTER:
return getFilters();
}
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_COMPOSE_CONCEPT_SET__SYSTEM:
setSystem((Uri)newValue);
return;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__VERSION:
setVersion((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__CONCEPT:
getConcepts().clear();
getConcepts().addAll((Collection<? extends ValueSetComposeConceptSetConceptReference>)newValue);
return;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__FILTER:
getFilters().clear();
getFilters().addAll((Collection<? extends ValueSetComposeConceptSetFilter>)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_COMPOSE_CONCEPT_SET__SYSTEM:
setSystem((Uri)null);
return;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__VERSION:
setVersion((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__CONCEPT:
getConcepts().clear();
return;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__FILTER:
getFilters().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__SYSTEM:
return system != null;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__VERSION:
return version != null;
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__CONCEPT:
return concepts != null && !concepts.isEmpty();
case FhirResourcePackage.VALUE_SET_COMPOSE_CONCEPT_SET__FILTER:
return filters != null && !filters.isEmpty();
}
return super.eIsSet(featureID);
}
} //ValueSetComposeConceptSetImpl