Skip to content
Snippets Groups Projects
Select Git revision
  • 8cc75cdc4841d30638d0bca781e2a4774766f398
  • master default protected
  • bug-collection
3 results

TTPackageImpl.java

Blame
  • user avatar
    Antonio García-Domínguez authored
    8cc75cdc
    History
    TTPackageImpl.java 11.53 KiB
    /**
     */
    package ttc2019.tt.impl;
    
    import org.eclipse.emf.ecore.EAttribute;
    import org.eclipse.emf.ecore.EClass;
    import org.eclipse.emf.ecore.EPackage;
    import org.eclipse.emf.ecore.EReference;
    
    import org.eclipse.emf.ecore.impl.EPackageImpl;
    
    import ttc2019.tt.Cell;
    import ttc2019.tt.InputPort;
    import ttc2019.tt.OutputPort;
    import ttc2019.tt.Port;
    import ttc2019.tt.Row;
    import ttc2019.tt.TTFactory;
    import ttc2019.tt.TTPackage;
    import ttc2019.tt.TruthTable;
    
    /**
     * <!-- begin-user-doc -->
     * An implementation of the model <b>Package</b>.
     * <!-- end-user-doc -->
     * @generated
     */
    public class TTPackageImpl extends EPackageImpl implements TTPackage {
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private EClass truthTableEClass = null;
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private EClass portEClass = null;
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private EClass inputPortEClass = null;
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private EClass outputPortEClass = null;
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private EClass rowEClass = null;
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private EClass cellEClass = null;
    
    	/**
    	 * Creates an instance of the model <b>Package</b>, registered with
    	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
    	 * package URI value.
    	 * <p>Note: the correct way to create the package is via the static
    	 * factory method {@link #init init()}, which also performs
    	 * initialization of the package, or returns the registered package,
    	 * if one already exists.
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @see org.eclipse.emf.ecore.EPackage.Registry
    	 * @see ttc2019.tt.TTPackage#eNS_URI
    	 * @see #init()
    	 * @generated
    	 */
    	private TTPackageImpl() {
    		super(eNS_URI, TTFactory.eINSTANCE);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private static boolean isInited = false;
    
    	/**
    	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
    	 *
    	 * <p>This method is used to initialize {@link TTPackage#eINSTANCE} when that field is accessed.
    	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @see #eNS_URI
    	 * @see #createPackageContents()
    	 * @see #initializePackageContents()
    	 * @generated
    	 */
    	public static TTPackage init() {
    		if (isInited) return (TTPackage)EPackage.Registry.INSTANCE.getEPackage(TTPackage.eNS_URI);
    
    		// Obtain or create and register package
    		Object registeredTTPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
    		TTPackageImpl theTTPackage = registeredTTPackage instanceof TTPackageImpl ? (TTPackageImpl)registeredTTPackage : new TTPackageImpl();
    
    		isInited = true;
    
    		// Create package meta-data objects
    		theTTPackage.createPackageContents();
    
    		// Initialize created meta-data
    		theTTPackage.initializePackageContents();
    
    		// Mark meta-data to indicate it can't be changed
    		theTTPackage.freeze();
    
    		// Update the registry and return the package
    		EPackage.Registry.INSTANCE.put(TTPackage.eNS_URI, theTTPackage);
    		return theTTPackage;
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EClass getTruthTable() {
    		return truthTableEClass;
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EAttribute getTruthTable_Name() {
    		return (EAttribute)truthTableEClass.getEStructuralFeatures().get(0);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getTruthTable_Ports() {
    		return (EReference)truthTableEClass.getEStructuralFeatures().get(1);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getTruthTable_Rows() {
    		return (EReference)truthTableEClass.getEStructuralFeatures().get(2);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EClass getPort() {
    		return portEClass;
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EAttribute getPort_Name() {
    		return (EAttribute)portEClass.getEStructuralFeatures().get(0);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getPort_Owner() {
    		return (EReference)portEClass.getEStructuralFeatures().get(1);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getPort_Cells() {
    		return (EReference)portEClass.getEStructuralFeatures().get(2);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EClass getInputPort() {
    		return inputPortEClass;
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EClass getOutputPort() {
    		return outputPortEClass;
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EClass getRow() {
    		return rowEClass;
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getRow_Owner() {
    		return (EReference)rowEClass.getEStructuralFeatures().get(0);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getRow_Cells() {
    		return (EReference)rowEClass.getEStructuralFeatures().get(1);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EClass getCell() {
    		return cellEClass;
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EAttribute getCell_Value() {
    		return (EAttribute)cellEClass.getEStructuralFeatures().get(0);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getCell_Owner() {
    		return (EReference)cellEClass.getEStructuralFeatures().get(1);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public EReference getCell_Port() {
    		return (EReference)cellEClass.getEStructuralFeatures().get(2);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public TTFactory getTTFactory() {
    		return (TTFactory)getEFactoryInstance();
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private boolean isCreated = false;
    
    	/**
    	 * Creates the meta-model objects for the package.  This method is
    	 * guarded to have no affect on any invocation but its first.
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public void createPackageContents() {
    		if (isCreated) return;
    		isCreated = true;
    
    		// Create classes and their features
    		truthTableEClass = createEClass(TRUTH_TABLE);
    		createEAttribute(truthTableEClass, TRUTH_TABLE__NAME);
    		createEReference(truthTableEClass, TRUTH_TABLE__PORTS);
    		createEReference(truthTableEClass, TRUTH_TABLE__ROWS);
    
    		portEClass = createEClass(PORT);
    		createEAttribute(portEClass, PORT__NAME);
    		createEReference(portEClass, PORT__OWNER);
    		createEReference(portEClass, PORT__CELLS);
    
    		inputPortEClass = createEClass(INPUT_PORT);
    
    		outputPortEClass = createEClass(OUTPUT_PORT);
    
    		rowEClass = createEClass(ROW);
    		createEReference(rowEClass, ROW__OWNER);
    		createEReference(rowEClass, ROW__CELLS);
    
    		cellEClass = createEClass(CELL);
    		createEAttribute(cellEClass, CELL__VALUE);
    		createEReference(cellEClass, CELL__OWNER);
    		createEReference(cellEClass, CELL__PORT);
    	}
    
    	/**
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	private boolean isInitialized = false;
    
    	/**
    	 * Complete the initialization of the package and its meta-model.  This
    	 * method is guarded to have no affect on any invocation but its first.
    	 * <!-- begin-user-doc -->
    	 * <!-- end-user-doc -->
    	 * @generated
    	 */
    	public void initializePackageContents() {
    		if (isInitialized) return;
    		isInitialized = true;
    
    		// Initialize package
    		setName(eNAME);
    		setNsPrefix(eNS_PREFIX);
    		setNsURI(eNS_URI);
    
    		// Create type parameters
    
    		// Set bounds for type parameters
    
    		// Add supertypes to classes
    		inputPortEClass.getESuperTypes().add(this.getPort());
    		outputPortEClass.getESuperTypes().add(this.getPort());
    
    		// Initialize classes, features, and operations; add parameters
    		initEClass(truthTableEClass, TruthTable.class, "TruthTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    		initEAttribute(getTruthTable_Name(), ecorePackage.getEString(), "name", null, 1, 1, TruthTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    		initEReference(getTruthTable_Ports(), this.getPort(), this.getPort_Owner(), "ports", null, 1, -1, TruthTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    		initEReference(getTruthTable_Rows(), this.getRow(), this.getRow_Owner(), "rows", null, 2, -1, TruthTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    
    		initEClass(portEClass, Port.class, "Port", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    		initEAttribute(getPort_Name(), ecorePackage.getEString(), "name", null, 1, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    		initEReference(getPort_Owner(), this.getTruthTable(), this.getTruthTable_Ports(), "owner", null, 1, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    		initEReference(getPort_Cells(), this.getCell(), this.getCell_Port(), "cells", null, 0, -1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    
    		initEClass(inputPortEClass, InputPort.class, "InputPort", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    
    		initEClass(outputPortEClass, OutputPort.class, "OutputPort", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    
    		initEClass(rowEClass, Row.class, "Row", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    		initEReference(getRow_Owner(), this.getTruthTable(), this.getTruthTable_Rows(), "owner", null, 1, 1, Row.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    		initEReference(getRow_Cells(), this.getCell(), this.getCell_Owner(), "cells", null, 1, -1, Row.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    
    		initEClass(cellEClass, Cell.class, "Cell", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    		initEAttribute(getCell_Value(), ecorePackage.getEBoolean(), "value", null, 1, 1, Cell.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    		initEReference(getCell_Owner(), this.getRow(), this.getRow_Cells(), "owner", null, 1, 1, Cell.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    		initEReference(getCell_Port(), this.getPort(), this.getPort_Cells(), "port", null, 1, 1, Cell.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
    
    		// Create resource
    		createResource(eNS_URI);
    	}
    
    } //TTPackageImpl