Package net.cis.common.model.structure.impl

Source Code of net.cis.common.model.structure.impl.StructurePackageImpl

/**
*/
package net.cis.common.model.structure.impl;

import net.cis.common.model.base.BasePackage;

import net.cis.common.model.base.impl.BasePackageImpl;

import net.cis.common.model.descriptor.DescriptorPackage;

import net.cis.common.model.descriptor.impl.DescriptorPackageImpl;

import net.cis.common.model.modeler.ModelerPackage;

import net.cis.common.model.modeler.impl.ModelerPackageImpl;

import net.cis.common.model.sector.SectorPackage;

import net.cis.common.model.sector.impl.SectorPackageImpl;

import net.cis.common.model.shipdevice.ShipdevicePackage;

import net.cis.common.model.shipdevice.impl.ShipdevicePackageImpl;

import net.cis.common.model.spaceobject.SpaceobjectPackage;

import net.cis.common.model.spaceobject.impl.SpaceobjectPackageImpl;

import net.cis.common.model.structure.AbstractStructure;
import net.cis.common.model.structure.Jumpgate;
import net.cis.common.model.structure.Satellite;
import net.cis.common.model.structure.Ship;
import net.cis.common.model.structure.ShipType;
import net.cis.common.model.structure.Slot;
import net.cis.common.model.structure.Station;
import net.cis.common.model.structure.StructureFactory;
import net.cis.common.model.structure.StructurePackage;

import net.cis.common.model.universe.UniversePackage;

import net.cis.common.model.universe.impl.UniversePackageImpl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

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

/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class StructurePackageImpl extends EPackageImpl implements StructurePackage {
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass abstractStructureEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass stationEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass satelliteEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass jumpgateEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass shipEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass slotEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EEnum shipTypeEEnum = 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 net.cis.common.model.structure.StructurePackage#eNS_URI
   * @see #init()
   * @generated
   */
  private StructurePackageImpl() {
    super(eNS_URI, StructureFactory.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 StructurePackage#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 StructurePackage init() {
    if (isInited) return (StructurePackage)EPackage.Registry.INSTANCE.getEPackage(StructurePackage.eNS_URI);

    // Obtain or create and register package
    StructurePackageImpl theStructurePackage = (StructurePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof StructurePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new StructurePackageImpl());

    isInited = true;

    // Obtain or create and register interdependencies
    BasePackageImpl theBasePackage = (BasePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI) instanceof BasePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI) : BasePackage.eINSTANCE);
    ShipdevicePackageImpl theShipdevicePackage = (ShipdevicePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ShipdevicePackage.eNS_URI) instanceof ShipdevicePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ShipdevicePackage.eNS_URI) : ShipdevicePackage.eINSTANCE);
    ModelerPackageImpl theModelerPackage = (ModelerPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ModelerPackage.eNS_URI) instanceof ModelerPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ModelerPackage.eNS_URI) : ModelerPackage.eINSTANCE);
    DescriptorPackageImpl theDescriptorPackage = (DescriptorPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(DescriptorPackage.eNS_URI) instanceof DescriptorPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(DescriptorPackage.eNS_URI) : DescriptorPackage.eINSTANCE);
    SectorPackageImpl theSectorPackage = (SectorPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SectorPackage.eNS_URI) instanceof SectorPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SectorPackage.eNS_URI) : SectorPackage.eINSTANCE);
    SpaceobjectPackageImpl theSpaceobjectPackage = (SpaceobjectPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SpaceobjectPackage.eNS_URI) instanceof SpaceobjectPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SpaceobjectPackage.eNS_URI) : SpaceobjectPackage.eINSTANCE);
    UniversePackageImpl theUniversePackage = (UniversePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(UniversePackage.eNS_URI) instanceof UniversePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(UniversePackage.eNS_URI) : UniversePackage.eINSTANCE);

    // Create package meta-data objects
    theStructurePackage.createPackageContents();
    theBasePackage.createPackageContents();
    theShipdevicePackage.createPackageContents();
    theModelerPackage.createPackageContents();
    theDescriptorPackage.createPackageContents();
    theSectorPackage.createPackageContents();
    theSpaceobjectPackage.createPackageContents();
    theUniversePackage.createPackageContents();

    // Initialize created meta-data
    theStructurePackage.initializePackageContents();
    theBasePackage.initializePackageContents();
    theShipdevicePackage.initializePackageContents();
    theModelerPackage.initializePackageContents();
    theDescriptorPackage.initializePackageContents();
    theSectorPackage.initializePackageContents();
    theSpaceobjectPackage.initializePackageContents();
    theUniversePackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theStructurePackage.freeze();

 
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(StructurePackage.eNS_URI, theStructurePackage);
    return theStructurePackage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getAbstractStructure() {
    return abstractStructureEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getStation() {
    return stationEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSatellite() {
    return satelliteEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getJumpgate() {
    return jumpgateEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getJumpgate_LinkedJumpgate() {
    return (EReference)jumpgateEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getJumpgate_ParentSector() {
    return (EReference)jumpgateEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getShip() {
    return shipEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getShip_Height() {
    return (EAttribute)shipEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getShip_Width() {
    return (EAttribute)shipEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getShip_Length() {
    return (EAttribute)shipEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getShip_ShipType() {
    return (EAttribute)shipEClass.getEStructuralFeatures().get(3);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getShip_Weight() {
    return (EAttribute)shipEClass.getEStructuralFeatures().get(4);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getShip_MaxAngularVelocity() {
    return (EAttribute)shipEClass.getEStructuralFeatures().get(5);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getShip_MaxLinearVelocity() {
    return (EAttribute)shipEClass.getEStructuralFeatures().get(6);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getShip_Slots() {
    return (EReference)shipEClass.getEStructuralFeatures().get(7);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSlot() {
    return slotEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getSlot_SlotType() {
    return (EAttribute)slotEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getSlot_SlotSize() {
    return (EAttribute)slotEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EEnum getShipType() {
    return shipTypeEEnum;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public StructureFactory getStructureFactory() {
    return (StructureFactory)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
    abstractStructureEClass = createEClass(ABSTRACT_STRUCTURE);

    stationEClass = createEClass(STATION);

    satelliteEClass = createEClass(SATELLITE);

    jumpgateEClass = createEClass(JUMPGATE);
    createEReference(jumpgateEClass, JUMPGATE__LINKED_JUMPGATE);
    createEReference(jumpgateEClass, JUMPGATE__PARENT_SECTOR);

    shipEClass = createEClass(SHIP);
    createEAttribute(shipEClass, SHIP__HEIGHT);
    createEAttribute(shipEClass, SHIP__WIDTH);
    createEAttribute(shipEClass, SHIP__LENGTH);
    createEAttribute(shipEClass, SHIP__SHIP_TYPE);
    createEAttribute(shipEClass, SHIP__WEIGHT);
    createEAttribute(shipEClass, SHIP__MAX_ANGULAR_VELOCITY);
    createEAttribute(shipEClass, SHIP__MAX_LINEAR_VELOCITY);
    createEReference(shipEClass, SHIP__SLOTS);

    slotEClass = createEClass(SLOT);
    createEAttribute(slotEClass, SLOT__SLOT_TYPE);
    createEAttribute(slotEClass, SLOT__SLOT_SIZE);

    // Create enums
    shipTypeEEnum = createEEnum(SHIP_TYPE);
  }

  /**
   * <!-- 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);

    // Obtain other dependent packages
    BasePackage theBasePackage = (BasePackage)EPackage.Registry.INSTANCE.getEPackage(BasePackage.eNS_URI);
    SectorPackage theSectorPackage = (SectorPackage)EPackage.Registry.INSTANCE.getEPackage(SectorPackage.eNS_URI);
    ShipdevicePackage theShipdevicePackage = (ShipdevicePackage)EPackage.Registry.INSTANCE.getEPackage(ShipdevicePackage.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    abstractStructureEClass.getESuperTypes().add(theBasePackage.getAbstractNamedEntity());
    stationEClass.getESuperTypes().add(this.getAbstractStructure());
    satelliteEClass.getESuperTypes().add(this.getAbstractStructure());
    jumpgateEClass.getESuperTypes().add(this.getAbstractStructure());
    shipEClass.getESuperTypes().add(this.getAbstractStructure());

    // Initialize classes and features; add operations and parameters
    initEClass(abstractStructureEClass, AbstractStructure.class, "AbstractStructure", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(stationEClass, Station.class, "Station", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(satelliteEClass, Satellite.class, "Satellite", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(jumpgateEClass, Jumpgate.class, "Jumpgate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getJumpgate_LinkedJumpgate(), this.getJumpgate(), null, "linkedJumpgate", null, 0, 1, Jumpgate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getJumpgate_ParentSector(), theSectorPackage.getSector(), null, "parentSector", null, 1, 1, Jumpgate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(shipEClass, Ship.class, "Ship", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getShip_Height(), ecorePackage.getEFloat(), "height", null, 1, 1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getShip_Width(), ecorePackage.getEFloat(), "width", null, 1, 1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getShip_Length(), ecorePackage.getEFloat(), "length", null, 1, 1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getShip_ShipType(), this.getShipType(), "shipType", null, 1, 1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getShip_Weight(), ecorePackage.getEFloat(), "weight", null, 1, 1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getShip_MaxAngularVelocity(), ecorePackage.getEFloat(), "maxAngularVelocity", null, 1, 1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getShip_MaxLinearVelocity(), ecorePackage.getEFloat(), "maxLinearVelocity", null, 1, 1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getShip_Slots(), this.getSlot(), null, "slots", null, 0, -1, Ship.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(slotEClass, Slot.class, "Slot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getSlot_SlotType(), theShipdevicePackage.getSlotType(), "slotType", null, 1, 1, Slot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getSlot_SlotSize(), theShipdevicePackage.getSlotSize(), "slotSize", null, 1, 1, Slot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Initialize enums and add enum literals
    initEEnum(shipTypeEEnum, ShipType.class, "ShipType");
    addEEnumLiteral(shipTypeEEnum, ShipType.FIGHTER);
    addEEnumLiteral(shipTypeEEnum, ShipType.CARRIER);
    addEEnumLiteral(shipTypeEEnum, ShipType.FREIGHTER);

    // Create resource
    createResource(eNS_URI);

    // Create annotations
    // http://net.cis.common.model/serializable
    createSerializableAnnotations();
  }

  /**
   * Initializes the annotations for <b>http://net.cis.common.model/serializable</b>.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected void createSerializableAnnotations() {
    String source = "http://net.cis.common.model/serializable";   
    addAnnotation
      (this,
       source,
       new String[] {
       });
  }

} //StructurePackageImpl
TOP

Related Classes of net.cis.common.model.structure.impl.StructurePackageImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.