/**
 */
package org.etsi.mts.tdl.extendedconfigurations.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.extendedconfigurations.ExtendedConfigurationsPackage;
import org.etsi.mts.tdl.extendedconfigurations.ExtendedTestConfiguration;
import org.etsi.mts.tdl.extendedconfigurations.TestConfigurationInstance;
import org.etsi.mts.tdl.extendedconfigurations.TestConfigurationOperation;

import org.etsi.mts.tdl.impl.TestConfigurationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Extended Test Configuration</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link org.etsi.mts.tdl.extendedconfigurations.impl.ExtendedTestConfigurationImpl#getConfigurations <em>Configurations</em>}</li>
 *   <li>{@link org.etsi.mts.tdl.extendedconfigurations.impl.ExtendedTestConfigurationImpl#getOperations <em>Operations</em>}</li>
 * </ul>
 *
 * @generated
 */
public class ExtendedTestConfigurationImpl extends TestConfigurationImpl implements ExtendedTestConfiguration
{
	/**
	 * The cached value of the '{@link #getConfigurations() <em>Configurations</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConfigurations()
	 * @generated
	 * @ordered
	 */
	protected EList<TestConfigurationInstance> configurations;

	/**
	 * The cached value of the '{@link #getOperations() <em>Operations</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getOperations()
	 * @generated
	 * @ordered
	 */
	protected EList<TestConfigurationOperation> operations;

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

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

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EList<TestConfigurationInstance> getConfigurations()
	{
		if (configurations == null)
		{
			configurations = new EObjectContainmentEList<TestConfigurationInstance>(TestConfigurationInstance.class, this, ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__CONFIGURATIONS);
		}
		return configurations;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EList<TestConfigurationOperation> getOperations()
	{
		if (operations == null)
		{
			operations = new EObjectContainmentEList<TestConfigurationOperation>(TestConfigurationOperation.class, this, ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__OPERATIONS);
		}
		return operations;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
	{
		switch (featureID)
		{
			case ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__CONFIGURATIONS:
				return ((InternalEList<?>)getConfigurations()).basicRemove(otherEnd, msgs);
			case ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__OPERATIONS:
				return ((InternalEList<?>)getOperations()).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 ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__CONFIGURATIONS:
				return getConfigurations();
			case ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__OPERATIONS:
				return getOperations();
		}
		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 ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__CONFIGURATIONS:
				getConfigurations().clear();
				getConfigurations().addAll((Collection<? extends TestConfigurationInstance>)newValue);
				return;
			case ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__OPERATIONS:
				getOperations().clear();
				getOperations().addAll((Collection<? extends TestConfigurationOperation>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID)
	{
		switch (featureID)
		{
			case ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__CONFIGURATIONS:
				getConfigurations().clear();
				return;
			case ExtendedConfigurationsPackage.EXTENDED_TEST_CONFIGURATION__OPERATIONS:
				getOperations().clear();
				return;
		}
		super.eUnset(featureID);
	}

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

} //ExtendedTestConfigurationImpl
