| package org.eclipse.stem.diseasemodels.standard.impl; |
| |
| /******************************************************************************* |
| * Copyright (c) 2006 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 |
| *******************************************************************************/ |
| |
| 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.eclipse.emf.ecore.impl.EObjectImpl; |
| import org.eclipse.emf.ecore.util.EcoreUtil; |
| import org.eclipse.stem.diseasemodels.standard.DiseaseModelLabel; |
| import org.eclipse.stem.diseasemodels.standard.DiseaseModelState; |
| import org.eclipse.stem.diseasemodels.standard.StandardPackage; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object '<em><b>Disease Model State</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.stem.diseasemodels.standard.impl.DiseaseModelStateImpl#getLabel <em>Label</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public abstract class DiseaseModelStateImpl extends EObjectImpl implements |
| DiseaseModelState { |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DiseaseModelStateImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StandardPackage.Literals.DISEASE_MODEL_STATE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DiseaseModelLabel getLabel() { |
| if (eContainerFeatureID() != StandardPackage.DISEASE_MODEL_STATE__LABEL) return null; |
| return (DiseaseModelLabel)eContainer(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param newLabel |
| * @param msgs |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetLabel(DiseaseModelLabel newLabel, NotificationChain msgs) { |
| msgs = eBasicSetContainer((InternalEObject)newLabel, StandardPackage.DISEASE_MODEL_STATE__LABEL, msgs); |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param newLabel |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLabel(DiseaseModelLabel newLabel) { |
| if (newLabel != eInternalContainer() || (eContainerFeatureID() != StandardPackage.DISEASE_MODEL_STATE__LABEL && newLabel != null)) { |
| if (EcoreUtil.isAncestor(this, newLabel)) |
| throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ |
| NotificationChain msgs = null; |
| if (eInternalContainer() != null) |
| msgs = eBasicRemoveFromContainer(msgs); |
| if (newLabel != null) |
| msgs = ((InternalEObject)newLabel).eInverseAdd(this, StandardPackage.DISEASE_MODEL_LABEL__DISEASE_MODEL_STATE, DiseaseModelLabel.class, msgs); |
| msgs = basicSetLabel(newLabel, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StandardPackage.DISEASE_MODEL_STATE__LABEL, newLabel, newLabel)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param otherEnd |
| * @param featureID |
| * @param msgs |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case StandardPackage.DISEASE_MODEL_STATE__LABEL: |
| if (eInternalContainer() != null) |
| msgs = eBasicRemoveFromContainer(msgs); |
| return basicSetLabel((DiseaseModelLabel)otherEnd, msgs); |
| } |
| return super.eInverseAdd(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param otherEnd |
| * @param featureID |
| * @param msgs |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case StandardPackage.DISEASE_MODEL_STATE__LABEL: |
| return basicSetLabel(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param msgs |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
| switch (eContainerFeatureID()) { |
| case StandardPackage.DISEASE_MODEL_STATE__LABEL: |
| return eInternalContainer().eInverseRemove(this, StandardPackage.DISEASE_MODEL_LABEL__DISEASE_MODEL_STATE, DiseaseModelLabel.class, msgs); |
| } |
| return super.eBasicRemoveFromContainerFeature(msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param featureID |
| * @param resolve |
| * @param coreType |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case StandardPackage.DISEASE_MODEL_STATE__LABEL: |
| return getLabel(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param featureID |
| * @param newValue |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case StandardPackage.DISEASE_MODEL_STATE__LABEL: |
| setLabel((DiseaseModelLabel)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param featureID |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case StandardPackage.DISEASE_MODEL_STATE__LABEL: |
| setLabel((DiseaseModelLabel)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @param featureID |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StandardPackage.DISEASE_MODEL_STATE__LABEL: |
| return getLabel() != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * |
| * @return |
| * |
| * <!-- end-user-doc --> |
| * @generated NOT |
| */ |
| public String toString() { |
| if (eIsProxy()) |
| return super.toString(); |
| |
| StringBuffer result = new StringBuffer(); |
| return result.toString(); |
| } |
| |
| /** |
| * @see org.eclipse.stem.core.common.SanityChecker#sane() |
| */ |
| public boolean sane() { |
| boolean retValue = true; |
| return retValue; |
| } // sane |
| |
| } // DiseaseModelStateImpl |