blob: bfe87ce75b7a2044f2a1223ce3c6a19fcab148d4 [file] [log] [blame]
/**
*/
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.CodeableConcept;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.GroupCharacteristic;
import org.hl7.fhir.Period;
import org.hl7.fhir.Quantity;
import org.hl7.fhir.Range;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Group Characteristic</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.GroupCharacteristicImpl#getCode <em>Code</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupCharacteristicImpl#getValueCodeableConcept <em>Value Codeable Concept</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupCharacteristicImpl#getValueBoolean <em>Value Boolean</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupCharacteristicImpl#getValueQuantity <em>Value Quantity</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupCharacteristicImpl#getValueRange <em>Value Range</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupCharacteristicImpl#getExclude <em>Exclude</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupCharacteristicImpl#getPeriod <em>Period</em>}</li>
* </ul>
*
* @generated
*/
public class GroupCharacteristicImpl extends BackboneElementImpl implements GroupCharacteristic {
/**
* The cached value of the '{@link #getCode() <em>Code</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCode()
* @generated
* @ordered
*/
protected CodeableConcept code;
/**
* The cached value of the '{@link #getValueCodeableConcept() <em>Value Codeable Concept</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValueCodeableConcept()
* @generated
* @ordered
*/
protected CodeableConcept valueCodeableConcept;
/**
* The cached value of the '{@link #getValueBoolean() <em>Value Boolean</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValueBoolean()
* @generated
* @ordered
*/
protected org.hl7.fhir.Boolean valueBoolean;
/**
* The cached value of the '{@link #getValueQuantity() <em>Value Quantity</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValueQuantity()
* @generated
* @ordered
*/
protected Quantity valueQuantity;
/**
* The cached value of the '{@link #getValueRange() <em>Value Range</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValueRange()
* @generated
* @ordered
*/
protected Range valueRange;
/**
* The cached value of the '{@link #getExclude() <em>Exclude</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExclude()
* @generated
* @ordered
*/
protected org.hl7.fhir.Boolean exclude;
/**
* The cached value of the '{@link #getPeriod() <em>Period</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPeriod()
* @generated
* @ordered
*/
protected Period period;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GroupCharacteristicImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getGroupCharacteristic();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getCode() {
return code;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCode(CodeableConcept newCode, NotificationChain msgs) {
CodeableConcept oldCode = code;
code = newCode;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__CODE, oldCode, newCode);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCode(CodeableConcept newCode) {
if (newCode != code) {
NotificationChain msgs = null;
if (code != null)
msgs = ((InternalEObject)code).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__CODE, null, msgs);
if (newCode != null)
msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__CODE, null, msgs);
msgs = basicSetCode(newCode, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__CODE, newCode, newCode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getValueCodeableConcept() {
return valueCodeableConcept;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetValueCodeableConcept(CodeableConcept newValueCodeableConcept, NotificationChain msgs) {
CodeableConcept oldValueCodeableConcept = valueCodeableConcept;
valueCodeableConcept = newValueCodeableConcept;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT, oldValueCodeableConcept, newValueCodeableConcept);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValueCodeableConcept(CodeableConcept newValueCodeableConcept) {
if (newValueCodeableConcept != valueCodeableConcept) {
NotificationChain msgs = null;
if (valueCodeableConcept != null)
msgs = ((InternalEObject)valueCodeableConcept).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT, null, msgs);
if (newValueCodeableConcept != null)
msgs = ((InternalEObject)newValueCodeableConcept).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT, null, msgs);
msgs = basicSetValueCodeableConcept(newValueCodeableConcept, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT, newValueCodeableConcept, newValueCodeableConcept));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.Boolean getValueBoolean() {
return valueBoolean;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetValueBoolean(org.hl7.fhir.Boolean newValueBoolean, NotificationChain msgs) {
org.hl7.fhir.Boolean oldValueBoolean = valueBoolean;
valueBoolean = newValueBoolean;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN, oldValueBoolean, newValueBoolean);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValueBoolean(org.hl7.fhir.Boolean newValueBoolean) {
if (newValueBoolean != valueBoolean) {
NotificationChain msgs = null;
if (valueBoolean != null)
msgs = ((InternalEObject)valueBoolean).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN, null, msgs);
if (newValueBoolean != null)
msgs = ((InternalEObject)newValueBoolean).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN, null, msgs);
msgs = basicSetValueBoolean(newValueBoolean, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN, newValueBoolean, newValueBoolean));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Quantity getValueQuantity() {
return valueQuantity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetValueQuantity(Quantity newValueQuantity, NotificationChain msgs) {
Quantity oldValueQuantity = valueQuantity;
valueQuantity = newValueQuantity;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY, oldValueQuantity, newValueQuantity);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValueQuantity(Quantity newValueQuantity) {
if (newValueQuantity != valueQuantity) {
NotificationChain msgs = null;
if (valueQuantity != null)
msgs = ((InternalEObject)valueQuantity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY, null, msgs);
if (newValueQuantity != null)
msgs = ((InternalEObject)newValueQuantity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY, null, msgs);
msgs = basicSetValueQuantity(newValueQuantity, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY, newValueQuantity, newValueQuantity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Range getValueRange() {
return valueRange;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetValueRange(Range newValueRange, NotificationChain msgs) {
Range oldValueRange = valueRange;
valueRange = newValueRange;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE, oldValueRange, newValueRange);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValueRange(Range newValueRange) {
if (newValueRange != valueRange) {
NotificationChain msgs = null;
if (valueRange != null)
msgs = ((InternalEObject)valueRange).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE, null, msgs);
if (newValueRange != null)
msgs = ((InternalEObject)newValueRange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE, null, msgs);
msgs = basicSetValueRange(newValueRange, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE, newValueRange, newValueRange));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.Boolean getExclude() {
return exclude;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExclude(org.hl7.fhir.Boolean newExclude, NotificationChain msgs) {
org.hl7.fhir.Boolean oldExclude = exclude;
exclude = newExclude;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE, oldExclude, newExclude);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExclude(org.hl7.fhir.Boolean newExclude) {
if (newExclude != exclude) {
NotificationChain msgs = null;
if (exclude != null)
msgs = ((InternalEObject)exclude).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE, null, msgs);
if (newExclude != null)
msgs = ((InternalEObject)newExclude).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE, null, msgs);
msgs = basicSetExclude(newExclude, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE, newExclude, newExclude));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Period getPeriod() {
return period;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPeriod(Period newPeriod, NotificationChain msgs) {
Period oldPeriod = period;
period = newPeriod;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__PERIOD, oldPeriod, newPeriod);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPeriod(Period newPeriod) {
if (newPeriod != period) {
NotificationChain msgs = null;
if (period != null)
msgs = ((InternalEObject)period).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__PERIOD, null, msgs);
if (newPeriod != null)
msgs = ((InternalEObject)newPeriod).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP_CHARACTERISTIC__PERIOD, null, msgs);
msgs = basicSetPeriod(newPeriod, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP_CHARACTERISTIC__PERIOD, newPeriod, newPeriod));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.GROUP_CHARACTERISTIC__CODE:
return basicSetCode(null, msgs);
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT:
return basicSetValueCodeableConcept(null, msgs);
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN:
return basicSetValueBoolean(null, msgs);
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY:
return basicSetValueQuantity(null, msgs);
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE:
return basicSetValueRange(null, msgs);
case FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE:
return basicSetExclude(null, msgs);
case FhirPackage.GROUP_CHARACTERISTIC__PERIOD:
return basicSetPeriod(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.GROUP_CHARACTERISTIC__CODE:
return getCode();
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT:
return getValueCodeableConcept();
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN:
return getValueBoolean();
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY:
return getValueQuantity();
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE:
return getValueRange();
case FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE:
return getExclude();
case FhirPackage.GROUP_CHARACTERISTIC__PERIOD:
return getPeriod();
}
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.GROUP_CHARACTERISTIC__CODE:
setCode((CodeableConcept)newValue);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT:
setValueCodeableConcept((CodeableConcept)newValue);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN:
setValueBoolean((org.hl7.fhir.Boolean)newValue);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY:
setValueQuantity((Quantity)newValue);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE:
setValueRange((Range)newValue);
return;
case FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE:
setExclude((org.hl7.fhir.Boolean)newValue);
return;
case FhirPackage.GROUP_CHARACTERISTIC__PERIOD:
setPeriod((Period)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.GROUP_CHARACTERISTIC__CODE:
setCode((CodeableConcept)null);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT:
setValueCodeableConcept((CodeableConcept)null);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN:
setValueBoolean((org.hl7.fhir.Boolean)null);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY:
setValueQuantity((Quantity)null);
return;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE:
setValueRange((Range)null);
return;
case FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE:
setExclude((org.hl7.fhir.Boolean)null);
return;
case FhirPackage.GROUP_CHARACTERISTIC__PERIOD:
setPeriod((Period)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.GROUP_CHARACTERISTIC__CODE:
return code != null;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_CODEABLE_CONCEPT:
return valueCodeableConcept != null;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_BOOLEAN:
return valueBoolean != null;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_QUANTITY:
return valueQuantity != null;
case FhirPackage.GROUP_CHARACTERISTIC__VALUE_RANGE:
return valueRange != null;
case FhirPackage.GROUP_CHARACTERISTIC__EXCLUDE:
return exclude != null;
case FhirPackage.GROUP_CHARACTERISTIC__PERIOD:
return period != null;
}
return super.eIsSet(featureID);
}
} //GroupCharacteristicImpl