/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package de.lmu.ifi.pst.mdd4soa.transform.impl.iom.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import de.lmu.ifi.pst.mdd4soa.transform.exception.TransformationException;
import de.lmu.ifi.pst.mdd4soa.transform.impl.iom.IOMPackage;
import de.lmu.ifi.pst.mdd4soa.transform.impl.iom.InteractionParameter;
import de.lmu.ifi.pst.mdd4soa.transform.impl.iom.ServiceOperationParameter;
import de.lmu.ifi.pst.mdd4soa.transform.impl.iom.type.Type;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Interaction Parameter</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.lmu.ifi.pst.mdd4soa.transform.impl.iom.impl.InteractionParameterImpl#getOperationParameter <em>Operation Parameter</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class InteractionParameterImpl extends EObjectImpl implements InteractionParameter {
	/**
	 * The cached value of the '{@link #getOperationParameter() <em>Operation Parameter</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getOperationParameter()
	 * @generated
	 * @ordered
	 */
	protected ServiceOperationParameter operationParameter;

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

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

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ServiceOperationParameter getOperationParameter() {
		if (operationParameter != null && operationParameter.eIsProxy()) {
			InternalEObject oldOperationParameter = (InternalEObject)operationParameter;
			operationParameter = (ServiceOperationParameter)eResolveProxy(oldOperationParameter);
			if (operationParameter != oldOperationParameter) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, IOMPackage.INTERACTION_PARAMETER__OPERATION_PARAMETER, oldOperationParameter, operationParameter));
			}
		}
		return operationParameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ServiceOperationParameter basicGetOperationParameter() {
		return operationParameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setOperationParameter(ServiceOperationParameter newOperationParameter) {
		ServiceOperationParameter oldOperationParameter = operationParameter;
		operationParameter = newOperationParameter;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, IOMPackage.INTERACTION_PARAMETER__OPERATION_PARAMETER, oldOperationParameter, operationParameter));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case IOMPackage.INTERACTION_PARAMETER__OPERATION_PARAMETER:
				if (resolve) return getOperationParameter();
				return basicGetOperationParameter();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case IOMPackage.INTERACTION_PARAMETER__OPERATION_PARAMETER:
				setOperationParameter((ServiceOperationParameter)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case IOMPackage.INTERACTION_PARAMETER__OPERATION_PARAMETER:
				setOperationParameter((ServiceOperationParameter)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case IOMPackage.INTERACTION_PARAMETER__OPERATION_PARAMETER:
				return operationParameter != null;
		}
		return super.eIsSet(featureID);
	}

	@Override
	public Type getType() throws TransformationException {
		return getExpression().getType();
	}

	

} //InteractionParameterImpl
