001    /**
002     * <copyright>
003     * </copyright>
004     *
005     * $Id$
006     */
007    package com.hammurapi.flow.impl;
008    
009    import com.hammurapi.config.ConfigPackage;
010    
011    import com.hammurapi.flow.Flow;
012    import com.hammurapi.flow.FlowElement;
013    import com.hammurapi.flow.FlowFactory;
014    import com.hammurapi.flow.FlowPackage;
015    import com.hammurapi.flow.Node;
016    import com.hammurapi.flow.Pin;
017    import com.hammurapi.flow.Transition;
018    
019    import org.eclipse.emf.ecore.EAttribute;
020    import org.eclipse.emf.ecore.EClass;
021    import org.eclipse.emf.ecore.EPackage;
022    import org.eclipse.emf.ecore.EReference;
023    
024    import org.eclipse.emf.ecore.impl.EPackageImpl;
025    
026    /**
027     * <!-- begin-user-doc -->
028     * An implementation of the model <b>Package</b>.
029     * <!-- end-user-doc -->
030     * @generated
031     */
032    public class FlowPackageImpl extends EPackageImpl implements FlowPackage {
033            /**
034             * <!-- begin-user-doc -->
035             * <!-- end-user-doc -->
036             * @generated
037             */
038            private EClass flowElementEClass = null;
039    
040            /**
041             * <!-- begin-user-doc -->
042             * <!-- end-user-doc -->
043             * @generated
044             */
045            private EClass nodeEClass = null;
046    
047            /**
048             * <!-- begin-user-doc -->
049             * <!-- end-user-doc -->
050             * @generated
051             */
052            private EClass flowEClass = null;
053    
054            /**
055             * <!-- begin-user-doc -->
056             * <!-- end-user-doc -->
057             * @generated
058             */
059            private EClass pinEClass = null;
060    
061            /**
062             * <!-- begin-user-doc -->
063             * <!-- end-user-doc -->
064             * @generated
065             */
066            private EClass transitionEClass = null;
067    
068            /**
069             * Creates an instance of the model <b>Package</b>, registered with
070             * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
071             * package URI value.
072             * <p>Note: the correct way to create the package is via the static
073             * factory method {@link #init init()}, which also performs
074             * initialization of the package, or returns the registered package,
075             * if one already exists.
076             * <!-- begin-user-doc -->
077             * <!-- end-user-doc -->
078             * @see org.eclipse.emf.ecore.EPackage.Registry
079             * @see com.hammurapi.flow.FlowPackage#eNS_URI
080             * @see #init()
081             * @generated
082             */
083            private FlowPackageImpl() {
084                    super(eNS_URI, FlowFactory.eINSTANCE);
085            }
086    
087            /**
088             * <!-- begin-user-doc -->
089             * <!-- end-user-doc -->
090             * @generated
091             */
092            private static boolean isInited = false;
093    
094            /**
095             * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
096             * 
097             * <p>This method is used to initialize {@link FlowPackage#eINSTANCE} when that field is accessed.
098             * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
099             * <!-- begin-user-doc -->
100             * <!-- end-user-doc -->
101             * @see #eNS_URI
102             * @see #createPackageContents()
103             * @see #initializePackageContents()
104             * @generated
105             */
106            public static FlowPackage init() {
107                    if (isInited) return (FlowPackage)EPackage.Registry.INSTANCE.getEPackage(FlowPackage.eNS_URI);
108    
109                    // Obtain or create and register package
110                    FlowPackageImpl theFlowPackage = (FlowPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FlowPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FlowPackageImpl());
111    
112                    isInited = true;
113    
114                    // Initialize simple dependencies
115                    ConfigPackage.eINSTANCE.eClass();
116    
117                    // Create package meta-data objects
118                    theFlowPackage.createPackageContents();
119    
120                    // Initialize created meta-data
121                    theFlowPackage.initializePackageContents();
122    
123                    // Mark meta-data to indicate it can't be changed
124                    theFlowPackage.freeze();
125    
126      
127                    // Update the registry and return the package
128                    EPackage.Registry.INSTANCE.put(FlowPackage.eNS_URI, theFlowPackage);
129                    return theFlowPackage;
130            }
131    
132            /**
133             * <!-- begin-user-doc -->
134             * <!-- end-user-doc -->
135             * @generated
136             */
137            public EClass getFlowElement() {
138                    return flowElementEClass;
139            }
140    
141            /**
142             * <!-- begin-user-doc -->
143             * <!-- end-user-doc -->
144             * @generated
145             */
146            public EReference getFlowElement_Flow() {
147                    return (EReference)flowElementEClass.getEStructuralFeatures().get(0);
148            }
149    
150            /**
151             * <!-- begin-user-doc -->
152             * <!-- end-user-doc -->
153             * @generated
154             */
155            public EReference getFlowElement_ViewConfig() {
156                    return (EReference)flowElementEClass.getEStructuralFeatures().get(1);
157            }
158    
159            /**
160             * <!-- begin-user-doc -->
161             * <!-- end-user-doc -->
162             * @generated
163             */
164            public EClass getNode() {
165                    return nodeEClass;
166            }
167    
168            /**
169             * <!-- begin-user-doc -->
170             * <!-- end-user-doc -->
171             * @generated
172             */
173            public EReference getNode_Pin() {
174                    return (EReference)nodeEClass.getEStructuralFeatures().get(0);
175            }
176    
177            /**
178             * <!-- begin-user-doc -->
179             * <!-- end-user-doc -->
180             * @generated
181             */
182            public EClass getFlow() {
183                    return flowEClass;
184            }
185    
186            /**
187             * <!-- begin-user-doc -->
188             * <!-- end-user-doc -->
189             * @generated
190             */
191            public EReference getFlow_FlowElement() {
192                    return (EReference)flowEClass.getEStructuralFeatures().get(0);
193            }
194    
195            /**
196             * <!-- begin-user-doc -->
197             * <!-- end-user-doc -->
198             * @generated
199             */
200            public EAttribute getFlow_FacadeInterface() {
201                    return (EAttribute)flowEClass.getEStructuralFeatures().get(1);
202            }
203    
204            /**
205             * <!-- begin-user-doc -->
206             * <!-- end-user-doc -->
207             * @generated
208             */
209            public EClass getPin() {
210                    return pinEClass;
211            }
212    
213            /**
214             * <!-- begin-user-doc -->
215             * <!-- end-user-doc -->
216             * @generated
217             */
218            public EReference getPin_Output() {
219                    return (EReference)pinEClass.getEStructuralFeatures().get(0);
220            }
221    
222            /**
223             * <!-- begin-user-doc -->
224             * <!-- end-user-doc -->
225             * @generated
226             */
227            public EReference getPin_Input() {
228                    return (EReference)pinEClass.getEStructuralFeatures().get(1);
229            }
230    
231            /**
232             * <!-- begin-user-doc -->
233             * <!-- end-user-doc -->
234             * @generated
235             */
236            public EReference getPin_Node() {
237                    return (EReference)pinEClass.getEStructuralFeatures().get(2);
238            }
239    
240            /**
241             * <!-- begin-user-doc -->
242             * <!-- end-user-doc -->
243             * @generated
244             */
245            public EAttribute getPin_Name() {
246                    return (EAttribute)pinEClass.getEStructuralFeatures().get(4);
247            }
248    
249            /**
250             * <!-- begin-user-doc -->
251             * <!-- end-user-doc -->
252             * @generated
253             */
254            public EReference getPin_PinConfig() {
255                    return (EReference)pinEClass.getEStructuralFeatures().get(3);
256            }
257    
258            /**
259             * <!-- begin-user-doc -->
260             * <!-- end-user-doc -->
261             * @generated
262             */
263            public EClass getTransition() {
264                    return transitionEClass;
265            }
266    
267            /**
268             * <!-- begin-user-doc -->
269             * <!-- end-user-doc -->
270             * @generated
271             */
272            public EReference getTransition_FromPin() {
273                    return (EReference)transitionEClass.getEStructuralFeatures().get(0);
274            }
275    
276            /**
277             * <!-- begin-user-doc -->
278             * <!-- end-user-doc -->
279             * @generated
280             */
281            public EReference getTransition_ToPin() {
282                    return (EReference)transitionEClass.getEStructuralFeatures().get(1);
283            }
284    
285            /**
286             * <!-- begin-user-doc -->
287             * <!-- end-user-doc -->
288             * @generated
289             */
290            public EReference getTransition_FromKey() {
291                    return (EReference)transitionEClass.getEStructuralFeatures().get(2);
292            }
293    
294            /**
295             * <!-- begin-user-doc -->
296             * <!-- end-user-doc -->
297             * @generated
298             */
299            public EReference getTransition_ToKey() {
300                    return (EReference)transitionEClass.getEStructuralFeatures().get(3);
301            }
302    
303            /**
304             * <!-- begin-user-doc -->
305             * <!-- end-user-doc -->
306             * @generated
307             */
308            public FlowFactory getFlowFactory() {
309                    return (FlowFactory)getEFactoryInstance();
310            }
311    
312            /**
313             * <!-- begin-user-doc -->
314             * <!-- end-user-doc -->
315             * @generated
316             */
317            private boolean isCreated = false;
318    
319            /**
320             * Creates the meta-model objects for the package.  This method is
321             * guarded to have no affect on any invocation but its first.
322             * <!-- begin-user-doc -->
323             * <!-- end-user-doc -->
324             * @generated
325             */
326            public void createPackageContents() {
327                    if (isCreated) return;
328                    isCreated = true;
329    
330                    // Create classes and their features
331                    flowElementEClass = createEClass(FLOW_ELEMENT);
332                    createEReference(flowElementEClass, FLOW_ELEMENT__FLOW);
333                    createEReference(flowElementEClass, FLOW_ELEMENT__VIEW_CONFIG);
334    
335                    nodeEClass = createEClass(NODE);
336                    createEReference(nodeEClass, NODE__PIN);
337    
338                    flowEClass = createEClass(FLOW);
339                    createEReference(flowEClass, FLOW__FLOW_ELEMENT);
340                    createEAttribute(flowEClass, FLOW__FACADE_INTERFACE);
341    
342                    pinEClass = createEClass(PIN);
343                    createEReference(pinEClass, PIN__OUTPUT);
344                    createEReference(pinEClass, PIN__INPUT);
345                    createEReference(pinEClass, PIN__NODE);
346                    createEReference(pinEClass, PIN__PIN_CONFIG);
347                    createEAttribute(pinEClass, PIN__NAME);
348    
349                    transitionEClass = createEClass(TRANSITION);
350                    createEReference(transitionEClass, TRANSITION__FROM_PIN);
351                    createEReference(transitionEClass, TRANSITION__TO_PIN);
352                    createEReference(transitionEClass, TRANSITION__FROM_KEY);
353                    createEReference(transitionEClass, TRANSITION__TO_KEY);
354            }
355    
356            /**
357             * <!-- begin-user-doc -->
358             * <!-- end-user-doc -->
359             * @generated
360             */
361            private boolean isInitialized = false;
362    
363            /**
364             * Complete the initialization of the package and its meta-model.  This
365             * method is guarded to have no affect on any invocation but its first.
366             * <!-- begin-user-doc -->
367             * <!-- end-user-doc -->
368             * @generated
369             */
370            public void initializePackageContents() {
371                    if (isInitialized) return;
372                    isInitialized = true;
373    
374                    // Initialize package
375                    setName(eNAME);
376                    setNsPrefix(eNS_PREFIX);
377                    setNsURI(eNS_URI);
378    
379                    // Obtain other dependent packages
380                    ConfigPackage theConfigPackage = (ConfigPackage)EPackage.Registry.INSTANCE.getEPackage(ConfigPackage.eNS_URI);
381    
382                    // Create type parameters
383    
384                    // Set bounds for type parameters
385    
386                    // Add supertypes to classes
387                    flowElementEClass.getESuperTypes().add(theConfigPackage.getNamedObjectDefinition());
388                    nodeEClass.getESuperTypes().add(this.getFlowElement());
389                    flowEClass.getESuperTypes().add(this.getNode());
390                    transitionEClass.getESuperTypes().add(this.getFlowElement());
391    
392                    // Initialize classes and features; add operations and parameters
393                    initEClass(flowElementEClass, FlowElement.class, "FlowElement", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
394                    initEReference(getFlowElement_Flow(), this.getFlow(), this.getFlow_FlowElement(), "flow", null, 0, 1, FlowElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
395                    initEReference(getFlowElement_ViewConfig(), theConfigPackage.getNamed(), null, "viewConfig", null, 0, -1, FlowElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
396    
397                    initEClass(nodeEClass, Node.class, "Node", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
398                    initEReference(getNode_Pin(), this.getPin(), this.getPin_Node(), "pin", null, 1, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
399    
400                    initEClass(flowEClass, Flow.class, "Flow", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
401                    initEReference(getFlow_FlowElement(), this.getFlowElement(), this.getFlowElement_Flow(), "flowElement", null, 0, -1, Flow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
402                    initEAttribute(getFlow_FacadeInterface(), ecorePackage.getEString(), "facadeInterface", null, 0, 1, Flow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
403    
404                    initEClass(pinEClass, Pin.class, "Pin", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
405                    initEReference(getPin_Output(), this.getTransition(), this.getTransition_FromPin(), "output", null, 0, -1, Pin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
406                    initEReference(getPin_Input(), this.getTransition(), this.getTransition_ToPin(), "input", null, 0, -1, Pin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
407                    initEReference(getPin_Node(), this.getNode(), this.getNode_Pin(), "node", null, 1, 1, Pin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
408                    initEReference(getPin_PinConfig(), theConfigPackage.getFactory(), null, "pinConfig", null, 0, 1, Pin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
409                    initEAttribute(getPin_Name(), ecorePackage.getEString(), "name", null, 1, 1, Pin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
410    
411                    initEClass(transitionEClass, Transition.class, "Transition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
412                    initEReference(getTransition_FromPin(), this.getPin(), this.getPin_Output(), "fromPin", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
413                    initEReference(getTransition_ToPin(), this.getPin(), this.getPin_Input(), "toPin", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
414                    initEReference(getTransition_FromKey(), theConfigPackage.getFactory(), null, "fromKey", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
415                    initEReference(getTransition_ToKey(), theConfigPackage.getFactory(), null, "toKey", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
416    
417                    // Create resource
418                    createResource(eNS_URI);
419            }
420    
421    } //FlowPackageImpl