/******************************************************************************* | |
* Copyright (c) 2009, 2011 IBM Corporation and others. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* IBM Corporation - initial API and implementation | |
*******************************************************************************/ | |
package org.eclipse.mdht.uml.hl7.datatypes.impl; | |
import java.util.Map; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.common.notify.NotificationChain; | |
import org.eclipse.emf.common.util.DiagnosticChain; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.mdht.uml.hl7.datatypes.DatatypesPackage; | |
import org.eclipse.mdht.uml.hl7.datatypes.IVL_TS; | |
import org.eclipse.mdht.uml.hl7.datatypes.IVXB_TS; | |
import org.eclipse.mdht.uml.hl7.datatypes.PQ; | |
import org.eclipse.mdht.uml.hl7.datatypes.TS; | |
import org.eclipse.mdht.uml.hl7.datatypes.operations.IVL_TSOperations; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>IVL TS</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.mdht.uml.hl7.datatypes.impl.IVL_TSImpl#getLow <em>Low</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.datatypes.impl.IVL_TSImpl#getCenter <em>Center</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.datatypes.impl.IVL_TSImpl#getWidth <em>Width</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.datatypes.impl.IVL_TSImpl#getHigh <em>High</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class IVL_TSImpl extends SXCM_TSImpl implements IVL_TS { | |
/** | |
* The cached value of the '{@link #getLow() <em>Low</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getLow() | |
* @generated | |
* @ordered | |
*/ | |
protected IVXB_TS low; | |
/** | |
* The cached value of the '{@link #getCenter() <em>Center</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getCenter() | |
* @generated | |
* @ordered | |
*/ | |
protected TS center; | |
/** | |
* The cached value of the '{@link #getWidth() <em>Width</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getWidth() | |
* @generated | |
* @ordered | |
*/ | |
protected PQ width; | |
/** | |
* The cached value of the '{@link #getHigh() <em>High</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getHigh() | |
* @generated | |
* @ordered | |
*/ | |
protected IVXB_TS high; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected IVL_TSImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return DatatypesPackage.Literals.IVL_TS; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public IVXB_TS getLow() { | |
return low; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetLow(IVXB_TS newLow, NotificationChain msgs) { | |
IVXB_TS oldLow = low; | |
low = newLow; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl( | |
this, Notification.SET, DatatypesPackage.IVL_TS__LOW, oldLow, newLow); | |
if (msgs == null) { | |
msgs = notification; | |
} else { | |
msgs.add(notification); | |
} | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setLow(IVXB_TS newLow) { | |
if (newLow != low) { | |
NotificationChain msgs = null; | |
if (low != null) { | |
msgs = ((InternalEObject) low).eInverseRemove( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__LOW, null, msgs); | |
} | |
if (newLow != null) { | |
msgs = ((InternalEObject) newLow).eInverseAdd( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__LOW, null, msgs); | |
} | |
msgs = basicSetLow(newLow, msgs); | |
if (msgs != null) { | |
msgs.dispatch(); | |
} | |
} else if (eNotificationRequired()) { | |
eNotify(new ENotificationImpl(this, Notification.SET, DatatypesPackage.IVL_TS__LOW, newLow, newLow)); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public TS getCenter() { | |
return center; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetCenter(TS newCenter, NotificationChain msgs) { | |
TS oldCenter = center; | |
center = newCenter; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl( | |
this, Notification.SET, DatatypesPackage.IVL_TS__CENTER, oldCenter, newCenter); | |
if (msgs == null) { | |
msgs = notification; | |
} else { | |
msgs.add(notification); | |
} | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setCenter(TS newCenter) { | |
if (newCenter != center) { | |
NotificationChain msgs = null; | |
if (center != null) { | |
msgs = ((InternalEObject) center).eInverseRemove( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__CENTER, null, msgs); | |
} | |
if (newCenter != null) { | |
msgs = ((InternalEObject) newCenter).eInverseAdd( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__CENTER, null, msgs); | |
} | |
msgs = basicSetCenter(newCenter, msgs); | |
if (msgs != null) { | |
msgs.dispatch(); | |
} | |
} else if (eNotificationRequired()) { | |
eNotify( | |
new ENotificationImpl(this, Notification.SET, DatatypesPackage.IVL_TS__CENTER, newCenter, newCenter)); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public IVXB_TS getHigh() { | |
return high; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetHigh(IVXB_TS newHigh, NotificationChain msgs) { | |
IVXB_TS oldHigh = high; | |
high = newHigh; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl( | |
this, Notification.SET, DatatypesPackage.IVL_TS__HIGH, oldHigh, newHigh); | |
if (msgs == null) { | |
msgs = notification; | |
} else { | |
msgs.add(notification); | |
} | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setHigh(IVXB_TS newHigh) { | |
if (newHigh != high) { | |
NotificationChain msgs = null; | |
if (high != null) { | |
msgs = ((InternalEObject) high).eInverseRemove( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__HIGH, null, msgs); | |
} | |
if (newHigh != null) { | |
msgs = ((InternalEObject) newHigh).eInverseAdd( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__HIGH, null, msgs); | |
} | |
msgs = basicSetHigh(newHigh, msgs); | |
if (msgs != null) { | |
msgs.dispatch(); | |
} | |
} else if (eNotificationRequired()) { | |
eNotify(new ENotificationImpl(this, Notification.SET, DatatypesPackage.IVL_TS__HIGH, newHigh, newHigh)); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public PQ getWidth() { | |
return width; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetWidth(PQ newWidth, NotificationChain msgs) { | |
PQ oldWidth = width; | |
width = newWidth; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl( | |
this, Notification.SET, DatatypesPackage.IVL_TS__WIDTH, oldWidth, newWidth); | |
if (msgs == null) { | |
msgs = notification; | |
} else { | |
msgs.add(notification); | |
} | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void setWidth(PQ newWidth) { | |
if (newWidth != width) { | |
NotificationChain msgs = null; | |
if (width != null) { | |
msgs = ((InternalEObject) width).eInverseRemove( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__WIDTH, null, msgs); | |
} | |
if (newWidth != null) { | |
msgs = ((InternalEObject) newWidth).eInverseAdd( | |
this, EOPPOSITE_FEATURE_BASE - DatatypesPackage.IVL_TS__WIDTH, null, msgs); | |
} | |
msgs = basicSetWidth(newWidth, msgs); | |
if (msgs != null) { | |
msgs.dispatch(); | |
} | |
} else if (eNotificationRequired()) { | |
eNotify(new ENotificationImpl(this, Notification.SET, DatatypesPackage.IVL_TS__WIDTH, newWidth, newWidth)); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public boolean validateOptionsContainingLow(DiagnosticChain diagnostics, Map<Object, Object> context) { | |
return IVL_TSOperations.validateOptionsContainingLow(this, diagnostics, context); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public boolean validateOptionsContainingCenter(DiagnosticChain diagnostics, Map<Object, Object> context) { | |
return IVL_TSOperations.validateOptionsContainingCenter(this, diagnostics, context); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public boolean validateOptionsContainingHigh(DiagnosticChain diagnostics, Map<Object, Object> context) { | |
return IVL_TSOperations.validateOptionsContainingHigh(this, diagnostics, context); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public boolean validateOptionsContainingWidth(DiagnosticChain diagnostics, Map<Object, Object> context) { | |
return IVL_TSOperations.validateOptionsContainingWidth(this, diagnostics, context); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case DatatypesPackage.IVL_TS__LOW: | |
return basicSetLow(null, msgs); | |
case DatatypesPackage.IVL_TS__CENTER: | |
return basicSetCenter(null, msgs); | |
case DatatypesPackage.IVL_TS__WIDTH: | |
return basicSetWidth(null, msgs); | |
case DatatypesPackage.IVL_TS__HIGH: | |
return basicSetHigh(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 DatatypesPackage.IVL_TS__LOW: | |
return getLow(); | |
case DatatypesPackage.IVL_TS__CENTER: | |
return getCenter(); | |
case DatatypesPackage.IVL_TS__WIDTH: | |
return getWidth(); | |
case DatatypesPackage.IVL_TS__HIGH: | |
return getHigh(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case DatatypesPackage.IVL_TS__LOW: | |
setLow((IVXB_TS) newValue); | |
return; | |
case DatatypesPackage.IVL_TS__CENTER: | |
setCenter((TS) newValue); | |
return; | |
case DatatypesPackage.IVL_TS__WIDTH: | |
setWidth((PQ) newValue); | |
return; | |
case DatatypesPackage.IVL_TS__HIGH: | |
setHigh((IVXB_TS) newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case DatatypesPackage.IVL_TS__LOW: | |
setLow((IVXB_TS) null); | |
return; | |
case DatatypesPackage.IVL_TS__CENTER: | |
setCenter((TS) null); | |
return; | |
case DatatypesPackage.IVL_TS__WIDTH: | |
setWidth((PQ) null); | |
return; | |
case DatatypesPackage.IVL_TS__HIGH: | |
setHigh((IVXB_TS) null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case DatatypesPackage.IVL_TS__LOW: | |
return low != null; | |
case DatatypesPackage.IVL_TS__CENTER: | |
return center != null; | |
case DatatypesPackage.IVL_TS__WIDTH: | |
return width != null; | |
case DatatypesPackage.IVL_TS__HIGH: | |
return high != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} // IVL_TSImpl |