/** | |
* Copyright (c) 2020 CEA LIST. | |
* | |
* 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\n\nContributors: | |
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr | |
* - Initial API and Implementation | |
*/ | |
package org.eclipse.efm.ecore.formalml.infrastructure.impl; | |
import java.util.Collection; | |
import org.eclipse.efm.ecore.formalml.infrastructure.Connector; | |
import org.eclipse.efm.ecore.formalml.infrastructure.InfrastructurePackage; | |
import org.eclipse.efm.ecore.formalml.infrastructure.ModelOfInteraction; | |
import org.eclipse.efm.ecore.formalml.infrastructure.Route; | |
import org.eclipse.emf.common.notify.NotificationChain; | |
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.MinimalEObjectImpl; | |
import org.eclipse.emf.ecore.util.EObjectContainmentEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Model Of Interaction</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModelOfInteractionImpl#getRoutes <em>Routes</em>}</li> | |
* <li>{@link org.eclipse.efm.ecore.formalml.infrastructure.impl.ModelOfInteractionImpl#getConnectors <em>Connectors</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class ModelOfInteractionImpl extends MinimalEObjectImpl.Container implements ModelOfInteraction { | |
/** | |
* The cached value of the '{@link #getRoutes() <em>Routes</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getRoutes() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<Route> routes; | |
/** | |
* The cached value of the '{@link #getConnectors() <em>Connectors</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getConnectors() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<Connector> connectors; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected ModelOfInteractionImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return InfrastructurePackage.Literals.MODEL_OF_INTERACTION; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EList<Route> getRoutes() { | |
if (routes == null) { | |
routes = new EObjectContainmentEList<Route>(Route.class, this, InfrastructurePackage.MODEL_OF_INTERACTION__ROUTES); | |
} | |
return routes; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EList<Connector> getConnectors() { | |
if (connectors == null) { | |
connectors = new EObjectContainmentEList<Connector>(Connector.class, this, InfrastructurePackage.MODEL_OF_INTERACTION__CONNECTORS); | |
} | |
return connectors; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case InfrastructurePackage.MODEL_OF_INTERACTION__ROUTES: | |
return ((InternalEList<?>)getRoutes()).basicRemove(otherEnd, msgs); | |
case InfrastructurePackage.MODEL_OF_INTERACTION__CONNECTORS: | |
return ((InternalEList<?>)getConnectors()).basicRemove(otherEnd, 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 InfrastructurePackage.MODEL_OF_INTERACTION__ROUTES: | |
return getRoutes(); | |
case InfrastructurePackage.MODEL_OF_INTERACTION__CONNECTORS: | |
return getConnectors(); | |
} | |
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 InfrastructurePackage.MODEL_OF_INTERACTION__ROUTES: | |
getRoutes().clear(); | |
getRoutes().addAll((Collection<? extends Route>)newValue); | |
return; | |
case InfrastructurePackage.MODEL_OF_INTERACTION__CONNECTORS: | |
getConnectors().clear(); | |
getConnectors().addAll((Collection<? extends Connector>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case InfrastructurePackage.MODEL_OF_INTERACTION__ROUTES: | |
getRoutes().clear(); | |
return; | |
case InfrastructurePackage.MODEL_OF_INTERACTION__CONNECTORS: | |
getConnectors().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case InfrastructurePackage.MODEL_OF_INTERACTION__ROUTES: | |
return routes != null && !routes.isEmpty(); | |
case InfrastructurePackage.MODEL_OF_INTERACTION__CONNECTORS: | |
return connectors != null && !connectors.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} //ModelOfInteractionImpl |