| /******************************************************************************* |
| * Copyright (c) 2016 David Carlson 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: |
| * David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.mdht.uml.fhir.core.resource.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| 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.EObjectResolvingEList; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.CodeableConcept; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Identifier; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Period; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| import org.eclipse.mdht.uml.fhir.core.resource.Resource; |
| import org.eclipse.mdht.uml.fhir.core.resource.Schedule; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Schedule</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ScheduleImpl#getIdentifiers <em>Identifier</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ScheduleImpl#getTypes <em>Type</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ScheduleImpl#getActor <em>Actor</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ScheduleImpl#getPlanningHorizon <em>Planning Horizon</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ScheduleImpl#getComment <em>Comment</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ScheduleImpl extends DomainResourceImpl implements Schedule { |
| /** |
| * The cached value of the '{@link #getIdentifiers() <em>Identifier</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIdentifiers() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Identifier> identifiers; |
| |
| /** |
| * The cached value of the '{@link #getTypes() <em>Type</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypes() |
| * @generated |
| * @ordered |
| */ |
| protected EList<CodeableConcept> types; |
| |
| /** |
| * The cached value of the '{@link #getActor() <em>Actor</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActor() |
| * @generated |
| * @ordered |
| */ |
| protected Resource actor; |
| |
| /** |
| * The cached value of the '{@link #getPlanningHorizon() <em>Planning Horizon</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPlanningHorizon() |
| * @generated |
| * @ordered |
| */ |
| protected Period planningHorizon; |
| |
| /** |
| * The cached value of the '{@link #getComment() <em>Comment</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getComment() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String comment; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ScheduleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getSchedule(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Identifier> getIdentifiers() { |
| if (identifiers == null) { |
| identifiers = new EObjectResolvingEList<Identifier>(Identifier.class, this, FhirResourcePackage.SCHEDULE__IDENTIFIER); |
| } |
| return identifiers; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<CodeableConcept> getTypes() { |
| if (types == null) { |
| types = new EObjectResolvingEList<CodeableConcept>(CodeableConcept.class, this, FhirResourcePackage.SCHEDULE__TYPE); |
| } |
| return types; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Resource getActor() { |
| if (actor != null && actor.eIsProxy()) { |
| InternalEObject oldActor = (InternalEObject)actor; |
| actor = (Resource)eResolveProxy(oldActor); |
| if (actor != oldActor) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.SCHEDULE__ACTOR, oldActor, actor)); |
| } |
| } |
| return actor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Resource basicGetActor() { |
| return actor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setActor(Resource newActor) { |
| Resource oldActor = actor; |
| actor = newActor; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.SCHEDULE__ACTOR, oldActor, actor)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Period getPlanningHorizon() { |
| if (planningHorizon != null && planningHorizon.eIsProxy()) { |
| InternalEObject oldPlanningHorizon = (InternalEObject)planningHorizon; |
| planningHorizon = (Period)eResolveProxy(oldPlanningHorizon); |
| if (planningHorizon != oldPlanningHorizon) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.SCHEDULE__PLANNING_HORIZON, oldPlanningHorizon, planningHorizon)); |
| } |
| } |
| return planningHorizon; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Period basicGetPlanningHorizon() { |
| return planningHorizon; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPlanningHorizon(Period newPlanningHorizon) { |
| Period oldPlanningHorizon = planningHorizon; |
| planningHorizon = newPlanningHorizon; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.SCHEDULE__PLANNING_HORIZON, oldPlanningHorizon, planningHorizon)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getComment() { |
| if (comment != null && comment.eIsProxy()) { |
| InternalEObject oldComment = (InternalEObject)comment; |
| comment = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldComment); |
| if (comment != oldComment) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.SCHEDULE__COMMENT, oldComment, comment)); |
| } |
| } |
| return comment; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetComment() { |
| return comment; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setComment(org.eclipse.mdht.uml.fhir.core.datatype.String newComment) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldComment = comment; |
| comment = newComment; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.SCHEDULE__COMMENT, oldComment, comment)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.SCHEDULE__IDENTIFIER: |
| return getIdentifiers(); |
| case FhirResourcePackage.SCHEDULE__TYPE: |
| return getTypes(); |
| case FhirResourcePackage.SCHEDULE__ACTOR: |
| if (resolve) return getActor(); |
| return basicGetActor(); |
| case FhirResourcePackage.SCHEDULE__PLANNING_HORIZON: |
| if (resolve) return getPlanningHorizon(); |
| return basicGetPlanningHorizon(); |
| case FhirResourcePackage.SCHEDULE__COMMENT: |
| if (resolve) return getComment(); |
| return basicGetComment(); |
| } |
| 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 FhirResourcePackage.SCHEDULE__IDENTIFIER: |
| getIdentifiers().clear(); |
| getIdentifiers().addAll((Collection<? extends Identifier>)newValue); |
| return; |
| case FhirResourcePackage.SCHEDULE__TYPE: |
| getTypes().clear(); |
| getTypes().addAll((Collection<? extends CodeableConcept>)newValue); |
| return; |
| case FhirResourcePackage.SCHEDULE__ACTOR: |
| setActor((Resource)newValue); |
| return; |
| case FhirResourcePackage.SCHEDULE__PLANNING_HORIZON: |
| setPlanningHorizon((Period)newValue); |
| return; |
| case FhirResourcePackage.SCHEDULE__COMMENT: |
| setComment((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.SCHEDULE__IDENTIFIER: |
| getIdentifiers().clear(); |
| return; |
| case FhirResourcePackage.SCHEDULE__TYPE: |
| getTypes().clear(); |
| return; |
| case FhirResourcePackage.SCHEDULE__ACTOR: |
| setActor((Resource)null); |
| return; |
| case FhirResourcePackage.SCHEDULE__PLANNING_HORIZON: |
| setPlanningHorizon((Period)null); |
| return; |
| case FhirResourcePackage.SCHEDULE__COMMENT: |
| setComment((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.SCHEDULE__IDENTIFIER: |
| return identifiers != null && !identifiers.isEmpty(); |
| case FhirResourcePackage.SCHEDULE__TYPE: |
| return types != null && !types.isEmpty(); |
| case FhirResourcePackage.SCHEDULE__ACTOR: |
| return actor != null; |
| case FhirResourcePackage.SCHEDULE__PLANNING_HORIZON: |
| return planningHorizon != null; |
| case FhirResourcePackage.SCHEDULE__COMMENT: |
| return comment != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ScheduleImpl |