/** | |
* 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.statemachine.impl; | |
import java.util.Collection; | |
import org.eclipse.efm.ecore.formalml.infrastructure.impl.BehaviorImpl; | |
import org.eclipse.efm.ecore.formalml.statemachine.Region; | |
import org.eclipse.efm.ecore.formalml.statemachine.Statemachine; | |
import org.eclipse.efm.ecore.formalml.statemachine.StatemachinePackage; | |
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.util.EObjectContainmentEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Statemachine</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.formalml.statemachine.impl.StatemachineImpl#getRegion <em>Region</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class StatemachineImpl extends BehaviorImpl implements Statemachine { | |
/** | |
* The cached value of the '{@link #getRegion() <em>Region</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getRegion() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<Region> region; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected StatemachineImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return StatemachinePackage.Literals.STATEMACHINE; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EList<Region> getRegion() { | |
if (region == null) { | |
region = new EObjectContainmentEList<Region>(Region.class, this, StatemachinePackage.STATEMACHINE__REGION); | |
} | |
return region; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case StatemachinePackage.STATEMACHINE__REGION: | |
return ((InternalEList<?>)getRegion()).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 StatemachinePackage.STATEMACHINE__REGION: | |
return getRegion(); | |
} | |
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 StatemachinePackage.STATEMACHINE__REGION: | |
getRegion().clear(); | |
getRegion().addAll((Collection<? extends Region>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case StatemachinePackage.STATEMACHINE__REGION: | |
getRegion().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case StatemachinePackage.STATEMACHINE__REGION: | |
return region != null && !region.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} //StatemachineImpl |