| /** |
| */ |
| 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.FhirPackage; |
| import org.hl7.fhir.ImagingObjectSelectionFrames; |
| import org.hl7.fhir.UnsignedInt; |
| import org.hl7.fhir.Uri; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Imaging Object Selection Frames</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ImagingObjectSelectionFramesImpl#getFrameNumbers <em>Frame Numbers</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ImagingObjectSelectionFramesImpl#getUrl <em>Url</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ImagingObjectSelectionFramesImpl extends BackboneElementImpl implements ImagingObjectSelectionFrames { |
| /** |
| * The cached value of the '{@link #getFrameNumbers() <em>Frame Numbers</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFrameNumbers() |
| * @generated |
| * @ordered |
| */ |
| protected EList<UnsignedInt> frameNumbers; |
| |
| /** |
| * The cached value of the '{@link #getUrl() <em>Url</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUrl() |
| * @generated |
| * @ordered |
| */ |
| protected Uri url; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ImagingObjectSelectionFramesImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getImagingObjectSelectionFrames(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<UnsignedInt> getFrameNumbers() { |
| if (frameNumbers == null) { |
| frameNumbers = new EObjectContainmentEList<UnsignedInt>(UnsignedInt.class, this, FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__FRAME_NUMBERS); |
| } |
| return frameNumbers; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getUrl() { |
| return url; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetUrl(Uri newUrl, NotificationChain msgs) { |
| Uri oldUrl = url; |
| url = newUrl; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL, oldUrl, newUrl); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUrl(Uri newUrl) { |
| if (newUrl != url) { |
| NotificationChain msgs = null; |
| if (url != null) |
| msgs = ((InternalEObject)url).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL, null, msgs); |
| if (newUrl != null) |
| msgs = ((InternalEObject)newUrl).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL, null, msgs); |
| msgs = basicSetUrl(newUrl, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL, newUrl, newUrl)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__FRAME_NUMBERS: |
| return ((InternalEList<?>)getFrameNumbers()).basicRemove(otherEnd, msgs); |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL: |
| return basicSetUrl(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.IMAGING_OBJECT_SELECTION_FRAMES__FRAME_NUMBERS: |
| return getFrameNumbers(); |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL: |
| return getUrl(); |
| } |
| 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.IMAGING_OBJECT_SELECTION_FRAMES__FRAME_NUMBERS: |
| getFrameNumbers().clear(); |
| getFrameNumbers().addAll((Collection<? extends UnsignedInt>)newValue); |
| return; |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL: |
| setUrl((Uri)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__FRAME_NUMBERS: |
| getFrameNumbers().clear(); |
| return; |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL: |
| setUrl((Uri)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__FRAME_NUMBERS: |
| return frameNumbers != null && !frameNumbers.isEmpty(); |
| case FhirPackage.IMAGING_OBJECT_SELECTION_FRAMES__URL: |
| return url != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ImagingObjectSelectionFramesImpl |