/** */ package fr.inria.diverse.iot2.iot2.iot2.impl; import fr.inria.diverse.iot2.iot2.iot2.Contained; import fr.inria.diverse.iot2.iot2.iot2.Container; import fr.inria.diverse.iot2.iot2.iot2.Iot2Package; import java.util.Collection; 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.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Container</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link fr.inria.diverse.iot2.iot2.iot2.impl.ContainerImpl#getContains <em>Contains</em>}</li> * </ul> * * @generated */ public abstract class ContainerImpl extends ContainedImpl implements Container { /** * The cached value of the '{@link #getContains() <em>Contains</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getContains() * @generated * @ordered */ protected EList<Contained> contains; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ContainerImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return Iot2Package.Literals.CONTAINER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<Contained> getContains() { if (contains == null) { contains = new EObjectContainmentWithInverseEList<Contained>(Contained.class, this, Iot2Package.CONTAINER__CONTAINS, Iot2Package.CONTAINED__DEFINED_IN); } return contains; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Iot2Package.CONTAINER__CONTAINS: return ((InternalEList<InternalEObject>)(InternalEList<?>)getContains()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case Iot2Package.CONTAINER__CONTAINS: return ((InternalEList<?>)getContains()).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 Iot2Package.CONTAINER__CONTAINS: return getContains(); } 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 Iot2Package.CONTAINER__CONTAINS: getContains().clear(); getContains().addAll((Collection<? extends Contained>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Iot2Package.CONTAINER__CONTAINS: getContains().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Iot2Package.CONTAINER__CONTAINS: return contains != null && !contains.isEmpty(); } return super.eIsSet(featureID); } } //ContainerImpl