/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.impl;

import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Architecture;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.BranchQuantity;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Comment;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.ComponentInstanciation;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.ConcurrentialStatement;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Constant;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Element;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.ElseStatement;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Entity;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Equation;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Expression;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.ForStatement;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Function;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Generic;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.GenericMap;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.IfThenStatement;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Library;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.LibraryForVhdlAms;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Map;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Nature;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Parameter;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.PortDirection;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.PortMap;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.ProcessVariable;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Quantity;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.QuantityPort;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Signal;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Statements;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Terminal;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Type;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Use;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.VAModel;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Variable;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.VhdlamsFactory;
import fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.VhdlamsPackage;

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;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class VhdlamsFactoryImpl extends EFactoryImpl implements VhdlamsFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static VhdlamsFactory init() {
		try {
			VhdlamsFactory theVhdlamsFactory = (VhdlamsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.femto-st.fr/disc/vhdlams.ecore"); 
			if (theVhdlamsFactory != null) {
				return theVhdlamsFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new VhdlamsFactoryImpl();
	}

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

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case VhdlamsPackage.ENTITY: return createEntity();
			case VhdlamsPackage.ARCHITECTURE: return createArchitecture();
			case VhdlamsPackage.ELEMENT: return createElement();
			case VhdlamsPackage.PACKAGE: return createPackage();
			case VhdlamsPackage.VA_MODEL: return createVAModel();
			case VhdlamsPackage.COMMENT: return createComment();
			case VhdlamsPackage.TERMINAL: return createTerminal();
			case VhdlamsPackage.SIGNAL: return createSignal();
			case VhdlamsPackage.QUANTITY_PORT: return createQuantityPort();
			case VhdlamsPackage.TYPE: return createType();
			case VhdlamsPackage.CONSTANT: return createConstant();
			case VhdlamsPackage.GENERIC: return createGeneric();
			case VhdlamsPackage.LIBRARY_FOR_VHDL_AMS: return createLibraryForVhdlAms();
			case VhdlamsPackage.COMPONENT_INSTANCIATION: return createComponentInstanciation();
			case VhdlamsPackage.PORT_MAP: return createPortMap();
			case VhdlamsPackage.LIBRARY: return createLibrary();
			case VhdlamsPackage.USE: return createUse();
			case VhdlamsPackage.NATURE: return createNature();
			case VhdlamsPackage.QUANTITY: return createQuantity();
			case VhdlamsPackage.BRANCH_QUANTITY: return createBranchQuantity();
			case VhdlamsPackage.VARIABLE: return createVariable();
			case VhdlamsPackage.FUNCTION: return createFunction();
			case VhdlamsPackage.PARAMETER: return createParameter();
			case VhdlamsPackage.MAP: return createMap();
			case VhdlamsPackage.GENERIC_MAP: return createGenericMap();
			case VhdlamsPackage.EXPRESSION: return createExpression();
			case VhdlamsPackage.CONCURRENTIAL_STATEMENT: return createConcurrentialStatement();
			case VhdlamsPackage.EQUATION: return createEquation();
			case VhdlamsPackage.PROCESS: return createProcess();
			case VhdlamsPackage.IF_THEN_STATEMENT: return createIfThenStatement();
			case VhdlamsPackage.ELSE_STATEMENT: return createElseStatement();
			case VhdlamsPackage.FOR_STATEMENT: return createForStatement();
			case VhdlamsPackage.STATEMENTS: return createStatements();
			case VhdlamsPackage.PROCESS_VARIABLE: return createProcessVariable();
			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 VhdlamsPackage.PORT_DIRECTION:
				return createPortDirectionFromString(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 VhdlamsPackage.PORT_DIRECTION:
				return convertPortDirectionToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Entity createEntity() {
		EntityImpl entity = new EntityImpl();
		return entity;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Architecture createArchitecture() {
		ArchitectureImpl architecture = new ArchitectureImpl();
		return architecture;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Element createElement() {
		ElementImpl element = new ElementImpl();
		return element;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Package createPackage() {
		PackageImpl package_ = new PackageImpl();
		return package_;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public VAModel createVAModel() {
		VAModelImpl vaModel = new VAModelImpl();
		return vaModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Comment createComment() {
		CommentImpl comment = new CommentImpl();
		return comment;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Terminal createTerminal() {
		TerminalImpl terminal = new TerminalImpl();
		return terminal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Signal createSignal() {
		SignalImpl signal = new SignalImpl();
		return signal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public QuantityPort createQuantityPort() {
		QuantityPortImpl quantityPort = new QuantityPortImpl();
		return quantityPort;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Type createType() {
		TypeImpl type = new TypeImpl();
		return type;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Constant createConstant() {
		ConstantImpl constant = new ConstantImpl();
		return constant;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Generic createGeneric() {
		GenericImpl generic = new GenericImpl();
		return generic;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LibraryForVhdlAms createLibraryForVhdlAms() {
		LibraryForVhdlAmsImpl libraryForVhdlAms = new LibraryForVhdlAmsImpl();
		return libraryForVhdlAms;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ComponentInstanciation createComponentInstanciation() {
		ComponentInstanciationImpl componentInstanciation = new ComponentInstanciationImpl();
		return componentInstanciation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PortMap createPortMap() {
		PortMapImpl portMap = new PortMapImpl();
		return portMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Library createLibrary() {
		LibraryImpl library = new LibraryImpl();
		return library;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Use createUse() {
		UseImpl use = new UseImpl();
		return use;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Nature createNature() {
		NatureImpl nature = new NatureImpl();
		return nature;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Quantity createQuantity() {
		QuantityImpl quantity = new QuantityImpl();
		return quantity;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BranchQuantity createBranchQuantity() {
		BranchQuantityImpl branchQuantity = new BranchQuantityImpl();
		return branchQuantity;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Variable createVariable() {
		VariableImpl variable = new VariableImpl();
		return variable;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Function createFunction() {
		FunctionImpl function = new FunctionImpl();
		return function;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Parameter createParameter() {
		ParameterImpl parameter = new ParameterImpl();
		return parameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Map createMap() {
		MapImpl map = new MapImpl();
		return map;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public GenericMap createGenericMap() {
		GenericMapImpl genericMap = new GenericMapImpl();
		return genericMap;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Expression createExpression() {
		ExpressionImpl expression = new ExpressionImpl();
		return expression;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ConcurrentialStatement createConcurrentialStatement() {
		ConcurrentialStatementImpl concurrentialStatement = new ConcurrentialStatementImpl();
		return concurrentialStatement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Equation createEquation() {
		EquationImpl equation = new EquationImpl();
		return equation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public fr.femtost.disc.eclipse.vhdlamsmetamodel.vhdlams.Process createProcess() {
		ProcessImpl process = new ProcessImpl();
		return process;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public IfThenStatement createIfThenStatement() {
		IfThenStatementImpl ifThenStatement = new IfThenStatementImpl();
		return ifThenStatement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ElseStatement createElseStatement() {
		ElseStatementImpl elseStatement = new ElseStatementImpl();
		return elseStatement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ForStatement createForStatement() {
		ForStatementImpl forStatement = new ForStatementImpl();
		return forStatement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Statements createStatements() {
		StatementsImpl statements = new StatementsImpl();
		return statements;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ProcessVariable createProcessVariable() {
		ProcessVariableImpl processVariable = new ProcessVariableImpl();
		return processVariable;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PortDirection createPortDirectionFromString(EDataType eDataType, String initialValue) {
		PortDirection result = PortDirection.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertPortDirectionToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

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

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

} //VhdlamsFactoryImpl
