/**
 */
package ua.ansymo.hintco.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import ua.ansymo.hintco.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class HintcoFactoryImpl extends EFactoryImpl implements HintcoFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static HintcoFactory init() {
		try {
			HintcoFactory theHintcoFactory = (HintcoFactory)EPackage.Registry.INSTANCE.getEFactory(HintcoPackage.eNS_URI);
			if (theHintcoFactory != null) {
				return theHintcoFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new HintcoFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public HintcoFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case HintcoPackage.CANDIDATES: return createCandidates();
			case HintcoPackage.VARIANT_DIAGRAM: return createVariantDiagram();
			case HintcoPackage.CANDIDATE_SCENARIO: return createCandidateScenario();
			case HintcoPackage.COSIM_UNIT_DECLARATION: return createCosimUnitDeclaration();
			case HintcoPackage.HIERARCHICAL_COSIM_UNIT_DECLARATION: return createHierarchicalCosimUnitDeclaration();
			case HintcoPackage.COSIM_UNIT_INSTANCE: return createCosimUnitInstance();
			case HintcoPackage.INPUT_PORT_DECLARATION: return createInputPortDeclaration();
			case HintcoPackage.OUTPUT_PORT_DECLARATION: return createOutputPortDeclaration();
			case HintcoPackage.INPUT_PORT_INSTANCE: return createInputPortInstance();
			case HintcoPackage.OUTPUT_PORT_INSTANCE: return createOutputPortInstance();
			case HintcoPackage.XOR_ADAPTATION: return createXorAdaptation();
			case HintcoPackage.EXTRAPOLATION_ADAPTATION: return createExtrapolationAdaptation();
			case HintcoPackage.INTERPOLATION_ADAPTATION: return createInterpolationAdaptation();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case HintcoPackage.INT:
				return createIntFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case HintcoPackage.INT:
				return convertIntToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Candidates createCandidates() {
		CandidatesImpl candidates = new CandidatesImpl();
		return candidates;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public VariantDiagram createVariantDiagram() {
		VariantDiagramImpl variantDiagram = new VariantDiagramImpl();
		return variantDiagram;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CandidateScenario createCandidateScenario() {
		CandidateScenarioImpl candidateScenario = new CandidateScenarioImpl();
		return candidateScenario;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CosimUnitDeclaration createCosimUnitDeclaration() {
		CosimUnitDeclarationImpl cosimUnitDeclaration = new CosimUnitDeclarationImpl();
		return cosimUnitDeclaration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public HierarchicalCosimUnitDeclaration createHierarchicalCosimUnitDeclaration() {
		HierarchicalCosimUnitDeclarationImpl hierarchicalCosimUnitDeclaration = new HierarchicalCosimUnitDeclarationImpl();
		return hierarchicalCosimUnitDeclaration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CosimUnitInstance createCosimUnitInstance() {
		CosimUnitInstanceImpl cosimUnitInstance = new CosimUnitInstanceImpl();
		return cosimUnitInstance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public InputPortDeclaration createInputPortDeclaration() {
		InputPortDeclarationImpl inputPortDeclaration = new InputPortDeclarationImpl();
		return inputPortDeclaration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OutputPortDeclaration createOutputPortDeclaration() {
		OutputPortDeclarationImpl outputPortDeclaration = new OutputPortDeclarationImpl();
		return outputPortDeclaration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public InputPortInstance createInputPortInstance() {
		InputPortInstanceImpl inputPortInstance = new InputPortInstanceImpl();
		return inputPortInstance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OutputPortInstance createOutputPortInstance() {
		OutputPortInstanceImpl outputPortInstance = new OutputPortInstanceImpl();
		return outputPortInstance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public XorAdaptation createXorAdaptation() {
		XorAdaptationImpl xorAdaptation = new XorAdaptationImpl();
		return xorAdaptation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ExtrapolationAdaptation createExtrapolationAdaptation() {
		ExtrapolationAdaptationImpl extrapolationAdaptation = new ExtrapolationAdaptationImpl();
		return extrapolationAdaptation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public InterpolationAdaptation createInterpolationAdaptation() {
		InterpolationAdaptationImpl interpolationAdaptation = new InterpolationAdaptationImpl();
		return interpolationAdaptation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Integer createIntFromString(EDataType eDataType, String initialValue) {
		return (Integer)super.createFromString(eDataType, initialValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertIntToString(EDataType eDataType, Object instanceValue) {
		return super.convertToString(eDataType, instanceValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public HintcoPackage getHintcoPackage() {
		return (HintcoPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static HintcoPackage getPackage() {
		return HintcoPackage.eINSTANCE;
	}

} //HintcoFactoryImpl
