| /** |
| */ |
| 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.Code; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.FilterOperator; |
| import org.hl7.fhir.ValueSetFilter; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Value Set Filter</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ValueSetFilterImpl#getProperty <em>Property</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ValueSetFilterImpl#getOp <em>Op</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ValueSetFilterImpl#getValue <em>Value</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ValueSetFilterImpl extends BackboneElementImpl implements ValueSetFilter { |
| /** |
| * The cached value of the '{@link #getProperty() <em>Property</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProperty() |
| * @generated |
| * @ordered |
| */ |
| protected Code property; |
| |
| /** |
| * The cached value of the '{@link #getOp() <em>Op</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOp() |
| * @generated |
| * @ordered |
| */ |
| protected FilterOperator op; |
| |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected Code value; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ValueSetFilterImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getValueSetFilter(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getProperty() { |
| return property; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetProperty(Code newProperty, NotificationChain msgs) { |
| Code oldProperty = property; |
| property = newProperty; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_FILTER__PROPERTY, oldProperty, newProperty); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProperty(Code newProperty) { |
| if (newProperty != property) { |
| NotificationChain msgs = null; |
| if (property != null) |
| msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_FILTER__PROPERTY, null, msgs); |
| if (newProperty != null) |
| msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_FILTER__PROPERTY, null, msgs); |
| msgs = basicSetProperty(newProperty, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_FILTER__PROPERTY, newProperty, newProperty)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FilterOperator getOp() { |
| return op; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetOp(FilterOperator newOp, NotificationChain msgs) { |
| FilterOperator oldOp = op; |
| op = newOp; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_FILTER__OP, oldOp, newOp); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOp(FilterOperator newOp) { |
| if (newOp != op) { |
| NotificationChain msgs = null; |
| if (op != null) |
| msgs = ((InternalEObject)op).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_FILTER__OP, null, msgs); |
| if (newOp != null) |
| msgs = ((InternalEObject)newOp).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_FILTER__OP, null, msgs); |
| msgs = basicSetOp(newOp, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_FILTER__OP, newOp, newOp)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetValue(Code newValue, NotificationChain msgs) { |
| Code oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_FILTER__VALUE, oldValue, newValue); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValue(Code newValue) { |
| if (newValue != value) { |
| NotificationChain msgs = null; |
| if (value != null) |
| msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_FILTER__VALUE, null, msgs); |
| if (newValue != null) |
| msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.VALUE_SET_FILTER__VALUE, null, msgs); |
| msgs = basicSetValue(newValue, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.VALUE_SET_FILTER__VALUE, newValue, newValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.VALUE_SET_FILTER__PROPERTY: |
| return basicSetProperty(null, msgs); |
| case FhirPackage.VALUE_SET_FILTER__OP: |
| return basicSetOp(null, msgs); |
| case FhirPackage.VALUE_SET_FILTER__VALUE: |
| return basicSetValue(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.VALUE_SET_FILTER__PROPERTY: |
| return getProperty(); |
| case FhirPackage.VALUE_SET_FILTER__OP: |
| return getOp(); |
| case FhirPackage.VALUE_SET_FILTER__VALUE: |
| return getValue(); |
| } |
| 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.VALUE_SET_FILTER__PROPERTY: |
| setProperty((Code)newValue); |
| return; |
| case FhirPackage.VALUE_SET_FILTER__OP: |
| setOp((FilterOperator)newValue); |
| return; |
| case FhirPackage.VALUE_SET_FILTER__VALUE: |
| setValue((Code)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_FILTER__PROPERTY: |
| setProperty((Code)null); |
| return; |
| case FhirPackage.VALUE_SET_FILTER__OP: |
| setOp((FilterOperator)null); |
| return; |
| case FhirPackage.VALUE_SET_FILTER__VALUE: |
| setValue((Code)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.VALUE_SET_FILTER__PROPERTY: |
| return property != null; |
| case FhirPackage.VALUE_SET_FILTER__OP: |
| return op != null; |
| case FhirPackage.VALUE_SET_FILTER__VALUE: |
| return value != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ValueSetFilterImpl |