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