| /** |
| */ |
| 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.Decimal; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.LocationPosition; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Location Position</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.LocationPositionImpl#getLongitude <em>Longitude</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.LocationPositionImpl#getLatitude <em>Latitude</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.LocationPositionImpl#getAltitude <em>Altitude</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LocationPositionImpl extends BackboneElementImpl implements LocationPosition { |
| /** |
| * The cached value of the '{@link #getLongitude() <em>Longitude</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLongitude() |
| * @generated |
| * @ordered |
| */ |
| protected Decimal longitude; |
| |
| /** |
| * The cached value of the '{@link #getLatitude() <em>Latitude</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLatitude() |
| * @generated |
| * @ordered |
| */ |
| protected Decimal latitude; |
| |
| /** |
| * The cached value of the '{@link #getAltitude() <em>Altitude</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAltitude() |
| * @generated |
| * @ordered |
| */ |
| protected Decimal altitude; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LocationPositionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getLocationPosition(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Decimal getLongitude() { |
| return longitude; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetLongitude(Decimal newLongitude, NotificationChain msgs) { |
| Decimal oldLongitude = longitude; |
| longitude = newLongitude; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.LOCATION_POSITION__LONGITUDE, oldLongitude, newLongitude); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLongitude(Decimal newLongitude) { |
| if (newLongitude != longitude) { |
| NotificationChain msgs = null; |
| if (longitude != null) |
| msgs = ((InternalEObject)longitude).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.LOCATION_POSITION__LONGITUDE, null, msgs); |
| if (newLongitude != null) |
| msgs = ((InternalEObject)newLongitude).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.LOCATION_POSITION__LONGITUDE, null, msgs); |
| msgs = basicSetLongitude(newLongitude, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.LOCATION_POSITION__LONGITUDE, newLongitude, newLongitude)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Decimal getLatitude() { |
| return latitude; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetLatitude(Decimal newLatitude, NotificationChain msgs) { |
| Decimal oldLatitude = latitude; |
| latitude = newLatitude; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.LOCATION_POSITION__LATITUDE, oldLatitude, newLatitude); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLatitude(Decimal newLatitude) { |
| if (newLatitude != latitude) { |
| NotificationChain msgs = null; |
| if (latitude != null) |
| msgs = ((InternalEObject)latitude).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.LOCATION_POSITION__LATITUDE, null, msgs); |
| if (newLatitude != null) |
| msgs = ((InternalEObject)newLatitude).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.LOCATION_POSITION__LATITUDE, null, msgs); |
| msgs = basicSetLatitude(newLatitude, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.LOCATION_POSITION__LATITUDE, newLatitude, newLatitude)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Decimal getAltitude() { |
| return altitude; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetAltitude(Decimal newAltitude, NotificationChain msgs) { |
| Decimal oldAltitude = altitude; |
| altitude = newAltitude; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.LOCATION_POSITION__ALTITUDE, oldAltitude, newAltitude); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAltitude(Decimal newAltitude) { |
| if (newAltitude != altitude) { |
| NotificationChain msgs = null; |
| if (altitude != null) |
| msgs = ((InternalEObject)altitude).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.LOCATION_POSITION__ALTITUDE, null, msgs); |
| if (newAltitude != null) |
| msgs = ((InternalEObject)newAltitude).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.LOCATION_POSITION__ALTITUDE, null, msgs); |
| msgs = basicSetAltitude(newAltitude, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.LOCATION_POSITION__ALTITUDE, newAltitude, newAltitude)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.LOCATION_POSITION__LONGITUDE: |
| return basicSetLongitude(null, msgs); |
| case FhirPackage.LOCATION_POSITION__LATITUDE: |
| return basicSetLatitude(null, msgs); |
| case FhirPackage.LOCATION_POSITION__ALTITUDE: |
| return basicSetAltitude(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.LOCATION_POSITION__LONGITUDE: |
| return getLongitude(); |
| case FhirPackage.LOCATION_POSITION__LATITUDE: |
| return getLatitude(); |
| case FhirPackage.LOCATION_POSITION__ALTITUDE: |
| return getAltitude(); |
| } |
| 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.LOCATION_POSITION__LONGITUDE: |
| setLongitude((Decimal)newValue); |
| return; |
| case FhirPackage.LOCATION_POSITION__LATITUDE: |
| setLatitude((Decimal)newValue); |
| return; |
| case FhirPackage.LOCATION_POSITION__ALTITUDE: |
| setAltitude((Decimal)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.LOCATION_POSITION__LONGITUDE: |
| setLongitude((Decimal)null); |
| return; |
| case FhirPackage.LOCATION_POSITION__LATITUDE: |
| setLatitude((Decimal)null); |
| return; |
| case FhirPackage.LOCATION_POSITION__ALTITUDE: |
| setAltitude((Decimal)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.LOCATION_POSITION__LONGITUDE: |
| return longitude != null; |
| case FhirPackage.LOCATION_POSITION__LATITUDE: |
| return latitude != null; |
| case FhirPackage.LOCATION_POSITION__ALTITUDE: |
| return altitude != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //LocationPositionImpl |