| /** |
| */ |
| package org.hl7.fhir.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.hl7.fhir.Code; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.ValueSetConcept1; |
| import org.hl7.fhir.ValueSetDesignation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Value Set Concept1</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ValueSetConcept1Impl#getCode <em>Code</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ValueSetConcept1Impl#getDisplay <em>Display</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ValueSetConcept1Impl#getDesignation <em>Designation</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ValueSetConcept1Impl extends BackboneElementImpl implements ValueSetConcept1 { |
| /** |
| * The cached value of the '{@link #getCode() <em>Code</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCode() |
| * @generated |
| * @ordered |
| */ |
| protected Code code; |
| |
| /** |
| * The cached value of the '{@link #getDisplay() <em>Display</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDisplay() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.String display; |
| |
| /** |
| * The cached value of the '{@link #getDesignation() <em>Designation</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDesignation() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ValueSetDesignation> designation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ValueSetConcept1Impl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getValueSetConcept1(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getCode() { |
| return code; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCode(Code newCode, NotificationChain msgs) { |
| Code oldCode = code; |
| code = newCode; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_CONCEPT1__CODE, oldCode, newCode); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCode(Code newCode) { |
| if (newCode != code) { |
| NotificationChain msgs = null; |
| if (code != null) |
| msgs = ((InternalEObject)code).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_CONCEPT1__CODE, null, msgs); |
| if (newCode != null) |
| msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_CONCEPT1__CODE, null, msgs); |
| msgs = basicSetCode(newCode, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_CONCEPT1__CODE, newCode, newCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.String getDisplay() { |
| return display; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetDisplay(org.hl7.fhir.String newDisplay, NotificationChain msgs) { |
| org.hl7.fhir.String oldDisplay = display; |
| display = newDisplay; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_CONCEPT1__DISPLAY, oldDisplay, newDisplay); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDisplay(org.hl7.fhir.String newDisplay) { |
| if (newDisplay != display) { |
| NotificationChain msgs = null; |
| if (display != null) |
| msgs = ((InternalEObject)display).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_CONCEPT1__DISPLAY, null, msgs); |
| if (newDisplay != null) |
| msgs = ((InternalEObject)newDisplay).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_CONCEPT1__DISPLAY, null, msgs); |
| msgs = basicSetDisplay(newDisplay, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_CONCEPT1__DISPLAY, newDisplay, newDisplay)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ValueSetDesignation> getDesignation() { |
| if (designation == null) { |
| designation = new EObjectContainmentEList<ValueSetDesignation>(ValueSetDesignation.class, this, FhirPackage.VALUE_SET_CONCEPT1__DESIGNATION); |
| } |
| return designation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.VALUE_SET_CONCEPT1__CODE: |
| return basicSetCode(null, msgs); |
| case FhirPackage.VALUE_SET_CONCEPT1__DISPLAY: |
| return basicSetDisplay(null, msgs); |
| case FhirPackage.VALUE_SET_CONCEPT1__DESIGNATION: |
| return ((InternalEList<?>)getDesignation()).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 FhirPackage.VALUE_SET_CONCEPT1__CODE: |
| return getCode(); |
| case FhirPackage.VALUE_SET_CONCEPT1__DISPLAY: |
| return getDisplay(); |
| case FhirPackage.VALUE_SET_CONCEPT1__DESIGNATION: |
| return getDesignation(); |
| } |
| 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 FhirPackage.VALUE_SET_CONCEPT1__CODE: |
| setCode((Code)newValue); |
| return; |
| case FhirPackage.VALUE_SET_CONCEPT1__DISPLAY: |
| setDisplay((org.hl7.fhir.String)newValue); |
| return; |
| case FhirPackage.VALUE_SET_CONCEPT1__DESIGNATION: |
| getDesignation().clear(); |
| getDesignation().addAll((Collection<? extends ValueSetDesignation>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.VALUE_SET_CONCEPT1__CODE: |
| setCode((Code)null); |
| return; |
| case FhirPackage.VALUE_SET_CONCEPT1__DISPLAY: |
| setDisplay((org.hl7.fhir.String)null); |
| return; |
| case FhirPackage.VALUE_SET_CONCEPT1__DESIGNATION: |
| getDesignation().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.VALUE_SET_CONCEPT1__CODE: |
| return code != null; |
| case FhirPackage.VALUE_SET_CONCEPT1__DISPLAY: |
| return display != null; |
| case FhirPackage.VALUE_SET_CONCEPT1__DESIGNATION: |
| return designation != null && !designation.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ValueSetConcept1Impl |