001    /**
002     * <copyright>
003     * </copyright>
004     *
005     * $Id$
006     */
007    package com.hammurapi.flow.impl;
008    
009    import com.hammurapi.flow.*;
010    
011    import org.eclipse.emf.ecore.EClass;
012    import org.eclipse.emf.ecore.EObject;
013    import org.eclipse.emf.ecore.EPackage;
014    
015    import org.eclipse.emf.ecore.impl.EFactoryImpl;
016    
017    import org.eclipse.emf.ecore.plugin.EcorePlugin;
018    
019    /**
020     * <!-- begin-user-doc -->
021     * An implementation of the model <b>Factory</b>.
022     * <!-- end-user-doc -->
023     * @generated
024     */
025    public class FlowFactoryImpl extends EFactoryImpl implements FlowFactory {
026            /**
027             * Creates the default factory implementation.
028             * <!-- begin-user-doc -->
029             * <!-- end-user-doc -->
030             * @generated
031             */
032            public static FlowFactory init() {
033                    try {
034                            FlowFactory theFlowFactory = (FlowFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.hammurapi.com/flow"); 
035                            if (theFlowFactory != null) {
036                                    return theFlowFactory;
037                            }
038                    }
039                    catch (Exception exception) {
040                            EcorePlugin.INSTANCE.log(exception);
041                    }
042                    return new FlowFactoryImpl();
043            }
044    
045            /**
046             * Creates an instance of the factory.
047             * <!-- begin-user-doc -->
048             * <!-- end-user-doc -->
049             * @generated
050             */
051            public FlowFactoryImpl() {
052                    super();
053            }
054    
055            /**
056             * <!-- begin-user-doc -->
057             * <!-- end-user-doc -->
058             * @generated
059             */
060            @Override
061            public EObject create(EClass eClass) {
062                    switch (eClass.getClassifierID()) {
063                            case FlowPackage.NODE: return createNode();
064                            case FlowPackage.FLOW: return createFlow();
065                            case FlowPackage.PIN: return createPin();
066                            case FlowPackage.TRANSITION: return createTransition();
067                            default:
068                                    throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
069                    }
070            }
071    
072            /**
073             * <!-- begin-user-doc -->
074             * <!-- end-user-doc -->
075             * @generated
076             */
077            public Node createNode() {
078                    NodeImpl node = new NodeImpl();
079                    return node;
080            }
081    
082            /**
083             * <!-- begin-user-doc -->
084             * <!-- end-user-doc -->
085             * @generated
086             */
087            public Flow createFlow() {
088                    FlowImpl flow = new FlowImpl();
089                    return flow;
090            }
091    
092            /**
093             * <!-- begin-user-doc -->
094             * <!-- end-user-doc -->
095             * @generated
096             */
097            public Pin createPin() {
098                    PinImpl pin = new PinImpl();
099                    return pin;
100            }
101    
102            /**
103             * <!-- begin-user-doc -->
104             * <!-- end-user-doc -->
105             * @generated
106             */
107            public Transition createTransition() {
108                    TransitionImpl transition = new TransitionImpl();
109                    return transition;
110            }
111    
112            /**
113             * <!-- begin-user-doc -->
114             * <!-- end-user-doc -->
115             * @generated
116             */
117            public FlowPackage getFlowPackage() {
118                    return (FlowPackage)getEPackage();
119            }
120    
121            /**
122             * <!-- begin-user-doc -->
123             * <!-- end-user-doc -->
124             * @deprecated
125             * @generated
126             */
127            @Deprecated
128            public static FlowPackage getPackage() {
129                    return FlowPackage.eINSTANCE;
130            }
131    
132    } //FlowFactoryImpl