| /** |
| */ |
| package org.hl7.fhir.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.Identifier; |
| import org.hl7.fhir.Reference; |
| import org.hl7.fhir.Uri; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Reference</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ReferenceImpl#getReference <em>Reference</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ReferenceImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ReferenceImpl#getIdentifier <em>Identifier</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ReferenceImpl#getDisplay <em>Display</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ReferenceImpl extends ElementImpl implements Reference { |
| /** |
| * The cached value of the '{@link #getReference() <em>Reference</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getReference() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.String reference; |
| |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected Uri type; |
| |
| /** |
| * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIdentifier() |
| * @generated |
| * @ordered |
| */ |
| protected Identifier identifier; |
| |
| /** |
| * 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ReferenceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getReference(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.String getReference() { |
| return reference; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetReference(org.hl7.fhir.String newReference, NotificationChain msgs) { |
| org.hl7.fhir.String oldReference = reference; |
| reference = newReference; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.REFERENCE__REFERENCE, oldReference, newReference); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setReference(org.hl7.fhir.String newReference) { |
| if (newReference != reference) { |
| NotificationChain msgs = null; |
| if (reference != null) |
| msgs = ((InternalEObject)reference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REFERENCE__REFERENCE, null, msgs); |
| if (newReference != null) |
| msgs = ((InternalEObject)newReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REFERENCE__REFERENCE, null, msgs); |
| msgs = basicSetReference(newReference, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.REFERENCE__REFERENCE, newReference, newReference)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetType(Uri newType, NotificationChain msgs) { |
| Uri oldType = type; |
| type = newType; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.REFERENCE__TYPE, oldType, newType); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setType(Uri newType) { |
| if (newType != type) { |
| NotificationChain msgs = null; |
| if (type != null) |
| msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REFERENCE__TYPE, null, msgs); |
| if (newType != null) |
| msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REFERENCE__TYPE, null, msgs); |
| msgs = basicSetType(newType, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.REFERENCE__TYPE, newType, newType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Identifier getIdentifier() { |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetIdentifier(Identifier newIdentifier, NotificationChain msgs) { |
| Identifier oldIdentifier = identifier; |
| identifier = newIdentifier; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.REFERENCE__IDENTIFIER, oldIdentifier, newIdentifier); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIdentifier(Identifier newIdentifier) { |
| if (newIdentifier != identifier) { |
| NotificationChain msgs = null; |
| if (identifier != null) |
| msgs = ((InternalEObject)identifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REFERENCE__IDENTIFIER, null, msgs); |
| if (newIdentifier != null) |
| msgs = ((InternalEObject)newIdentifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REFERENCE__IDENTIFIER, null, msgs); |
| msgs = basicSetIdentifier(newIdentifier, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.REFERENCE__IDENTIFIER, newIdentifier, newIdentifier)); |
| } |
| |
| /** |
| * <!-- 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.REFERENCE__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.REFERENCE__DISPLAY, null, msgs); |
| if (newDisplay != null) |
| msgs = ((InternalEObject)newDisplay).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REFERENCE__DISPLAY, null, msgs); |
| msgs = basicSetDisplay(newDisplay, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.REFERENCE__DISPLAY, newDisplay, newDisplay)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.REFERENCE__REFERENCE: |
| return basicSetReference(null, msgs); |
| case FhirPackage.REFERENCE__TYPE: |
| return basicSetType(null, msgs); |
| case FhirPackage.REFERENCE__IDENTIFIER: |
| return basicSetIdentifier(null, msgs); |
| case FhirPackage.REFERENCE__DISPLAY: |
| return basicSetDisplay(null, 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.REFERENCE__REFERENCE: |
| return getReference(); |
| case FhirPackage.REFERENCE__TYPE: |
| return getType(); |
| case FhirPackage.REFERENCE__IDENTIFIER: |
| return getIdentifier(); |
| case FhirPackage.REFERENCE__DISPLAY: |
| return getDisplay(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirPackage.REFERENCE__REFERENCE: |
| setReference((org.hl7.fhir.String)newValue); |
| return; |
| case FhirPackage.REFERENCE__TYPE: |
| setType((Uri)newValue); |
| return; |
| case FhirPackage.REFERENCE__IDENTIFIER: |
| setIdentifier((Identifier)newValue); |
| return; |
| case FhirPackage.REFERENCE__DISPLAY: |
| setDisplay((org.hl7.fhir.String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.REFERENCE__REFERENCE: |
| setReference((org.hl7.fhir.String)null); |
| return; |
| case FhirPackage.REFERENCE__TYPE: |
| setType((Uri)null); |
| return; |
| case FhirPackage.REFERENCE__IDENTIFIER: |
| setIdentifier((Identifier)null); |
| return; |
| case FhirPackage.REFERENCE__DISPLAY: |
| setDisplay((org.hl7.fhir.String)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.REFERENCE__REFERENCE: |
| return reference != null; |
| case FhirPackage.REFERENCE__TYPE: |
| return type != null; |
| case FhirPackage.REFERENCE__IDENTIFIER: |
| return identifier != null; |
| case FhirPackage.REFERENCE__DISPLAY: |
| return display != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ReferenceImpl |