/**
 */
package org.etsi.mts.tdl.impl;

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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.etsi.mts.tdl.BoundedLoopBehaviour;
import org.etsi.mts.tdl.LocalExpression;
import org.etsi.mts.tdl.tdlPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Bounded Loop Behaviour</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link org.etsi.mts.tdl.impl.BoundedLoopBehaviourImpl#getNumIteration <em>Num Iteration</em>}</li>
 * </ul>
 *
 * @generated
 */
public class BoundedLoopBehaviourImpl extends SingleCombinedBehaviourImpl implements BoundedLoopBehaviour
{
	/**
	 * The cached value of the '{@link #getNumIteration() <em>Num Iteration</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumIteration()
	 * @generated
	 * @ordered
	 */
	protected EList<LocalExpression> numIteration;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected BoundedLoopBehaviourImpl()
	{
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass()
	{
		return tdlPackage.Literals.BOUNDED_LOOP_BEHAVIOUR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EList<LocalExpression> getNumIteration()
	{
		if (numIteration == null) {
			numIteration = new EObjectContainmentEList<LocalExpression>(LocalExpression.class, this, tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION);
		}
		return numIteration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
	{
		switch (featureID) {
			case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION:
				return ((InternalEList<?>)getNumIteration()).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 tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION:
				return getNumIteration();
		}
		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 tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION:
				getNumIteration().clear();
				getNumIteration().addAll((Collection<? extends LocalExpression>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID)
	{
		switch (featureID) {
			case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION:
				getNumIteration().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID)
	{
		switch (featureID) {
			case tdlPackage.BOUNDED_LOOP_BEHAVIOUR__NUM_ITERATION:
				return numIteration != null && !numIteration.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //BoundedLoopBehaviourImpl
