| /**
|
| * *******************************************************************************
|
| * Copyright (c) 2008, 2019 Hatha Systems.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| * Nikolai Mansourov (Hatha Systems) - initial API and implementation
|
| * *******************************************************************************
|
| *
|
| * $Id$
|
| */ |
| package org.eclipse.modisco.omg.kdm.platform.impl;
|
|
|
| import org.eclipse.emf.common.notify.Notification;
|
| import org.eclipse.emf.ecore.EClass;
|
| import org.eclipse.emf.ecore.InternalEObject;
|
| import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
| import org.eclipse.modisco.omg.kdm.core.KDMEntity;
|
| import org.eclipse.modisco.omg.kdm.platform.AbstractPlatformElement;
|
| import org.eclipse.modisco.omg.kdm.platform.PlatformPackage;
|
| import org.eclipse.modisco.omg.kdm.platform.PlatformRelationship;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>Relationship</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.modisco.omg.kdm.platform.impl.PlatformRelationshipImpl#getTo <em>To</em>}</li>
|
| * <li>{@link org.eclipse.modisco.omg.kdm.platform.impl.PlatformRelationshipImpl#getFrom <em>From</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| */
|
| public class PlatformRelationshipImpl extends AbstractPlatformRelationshipImpl implements PlatformRelationship {
|
| /**
|
| * The cached value of the '{@link #getTo() <em>To</em>}' reference.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getTo()
|
| * @generated
|
| * @ordered
|
| */
|
| protected KDMEntity to;
|
|
|
| /**
|
| * The cached value of the '{@link #getFrom() <em>From</em>}' reference.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getFrom()
|
| * @generated
|
| * @ordered
|
| */
|
| protected AbstractPlatformElement from;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected PlatformRelationshipImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return PlatformPackage.Literals.PLATFORM_RELATIONSHIP;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public KDMEntity getTo() {
|
| if (to != null && to.eIsProxy()) {
|
| InternalEObject oldTo = (InternalEObject)to;
|
| to = (KDMEntity)eResolveProxy(oldTo);
|
| if (to != oldTo) {
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, PlatformPackage.PLATFORM_RELATIONSHIP__TO, oldTo, to));
|
| }
|
| }
|
| return to;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public KDMEntity basicGetTo() {
|
| return to;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setTo(KDMEntity newTo) {
|
| KDMEntity oldTo = to;
|
| to = newTo;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, PlatformPackage.PLATFORM_RELATIONSHIP__TO, oldTo, to));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public AbstractPlatformElement getFrom() {
|
| if (from != null && from.eIsProxy()) {
|
| InternalEObject oldFrom = (InternalEObject)from;
|
| from = (AbstractPlatformElement)eResolveProxy(oldFrom);
|
| if (from != oldFrom) {
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, PlatformPackage.PLATFORM_RELATIONSHIP__FROM, oldFrom, from));
|
| }
|
| }
|
| return from;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public AbstractPlatformElement basicGetFrom() {
|
| return from;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setFrom(AbstractPlatformElement newFrom) {
|
| AbstractPlatformElement oldFrom = from;
|
| from = newFrom;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, PlatformPackage.PLATFORM_RELATIONSHIP__FROM, oldFrom, from));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__TO:
|
| if (resolve) return getTo();
|
| return basicGetTo();
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__FROM:
|
| if (resolve) return getFrom();
|
| return basicGetFrom();
|
| }
|
| return super.eGet(featureID, resolve, coreType);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eSet(int featureID, Object newValue) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__TO:
|
| setTo((KDMEntity)newValue);
|
| return;
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__FROM:
|
| setFrom((AbstractPlatformElement)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__TO:
|
| setTo((KDMEntity)null);
|
| return;
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__FROM:
|
| setFrom((AbstractPlatformElement)null);
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__TO:
|
| return to != null;
|
| case PlatformPackage.PLATFORM_RELATIONSHIP__FROM:
|
| return from != null;
|
| }
|
| return super.eIsSet(featureID);
|
| }
|
|
|
| } //PlatformRelationshipImpl
|