314 lines
8.4 KiB
Java
314 lines
8.4 KiB
Java
/**
|
|
*/
|
|
package fr.tpt.mem4csd.loss.impl;
|
|
|
|
import fr.tpt.mem4csd.loss.Complex;
|
|
import fr.tpt.mem4csd.loss.Link;
|
|
import fr.tpt.mem4csd.loss.LossFactory;
|
|
import fr.tpt.mem4csd.loss.LossPackage;
|
|
import fr.tpt.mem4csd.loss.NamedObject;
|
|
import fr.tpt.mem4csd.loss.Primitive;
|
|
|
|
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;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* An implementation of the model <b>Package</b>.
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
public class LossPackageImpl extends EPackageImpl implements LossPackage {
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
private EClass namedObjectEClass = null;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
private EClass primitiveEClass = null;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
private EClass linkEClass = null;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
private EClass complexEClass = 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 fr.tpt.mem4csd.loss.LossPackage#eNS_URI
|
|
* @see #init()
|
|
* @generated
|
|
*/
|
|
private LossPackageImpl() {
|
|
super(eNS_URI, LossFactory.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 LossPackage#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 LossPackage init() {
|
|
if (isInited)
|
|
return (LossPackage) EPackage.Registry.INSTANCE.getEPackage(LossPackage.eNS_URI);
|
|
|
|
// Obtain or create and register package
|
|
Object registeredLossPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
|
|
LossPackageImpl theLossPackage = registeredLossPackage instanceof LossPackageImpl
|
|
? (LossPackageImpl) registeredLossPackage
|
|
: new LossPackageImpl();
|
|
|
|
isInited = true;
|
|
|
|
// Create package meta-data objects
|
|
theLossPackage.createPackageContents();
|
|
|
|
// Initialize created meta-data
|
|
theLossPackage.initializePackageContents();
|
|
|
|
// Mark meta-data to indicate it can't be changed
|
|
theLossPackage.freeze();
|
|
|
|
// Update the registry and return the package
|
|
EPackage.Registry.INSTANCE.put(LossPackage.eNS_URI, theLossPackage);
|
|
return theLossPackage;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EClass getNamedObject() {
|
|
return namedObjectEClass;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EAttribute getNamedObject_Name() {
|
|
return (EAttribute) namedObjectEClass.getEStructuralFeatures().get(0);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EAttribute getNamedObject_Qname() {
|
|
return (EAttribute) namedObjectEClass.getEStructuralFeatures().get(1);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EClass getPrimitive() {
|
|
return primitiveEClass;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EReference getPrimitive_Type() {
|
|
return (EReference) primitiveEClass.getEStructuralFeatures().get(0);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EClass getLink() {
|
|
return linkEClass;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EReference getLink_ReferenceTo() {
|
|
return (EReference) linkEClass.getEStructuralFeatures().get(0);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EClass getComplex() {
|
|
return complexEClass;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EReference getComplex_Primitives() {
|
|
return (EReference) complexEClass.getEStructuralFeatures().get(0);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public LossFactory getLossFactory() {
|
|
return (LossFactory) 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
|
|
namedObjectEClass = createEClass(NAMED_OBJECT);
|
|
createEAttribute(namedObjectEClass, NAMED_OBJECT__NAME);
|
|
createEAttribute(namedObjectEClass, NAMED_OBJECT__QNAME);
|
|
|
|
primitiveEClass = createEClass(PRIMITIVE);
|
|
createEReference(primitiveEClass, PRIMITIVE__TYPE);
|
|
|
|
linkEClass = createEClass(LINK);
|
|
createEReference(linkEClass, LINK__REFERENCE_TO);
|
|
|
|
complexEClass = createEClass(COMPLEX);
|
|
createEReference(complexEClass, COMPLEX__PRIMITIVES);
|
|
}
|
|
|
|
/**
|
|
* <!-- 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
|
|
primitiveEClass.getESuperTypes().add(this.getNamedObject());
|
|
linkEClass.getESuperTypes().add(this.getPrimitive());
|
|
complexEClass.getESuperTypes().add(this.getNamedObject());
|
|
|
|
// Initialize classes, features, and operations; add parameters
|
|
initEClass(namedObjectEClass, NamedObject.class, "NamedObject", IS_ABSTRACT, !IS_INTERFACE,
|
|
IS_GENERATED_INSTANCE_CLASS);
|
|
initEAttribute(getNamedObject_Name(), ecorePackage.getEString(), "name", null, 1, 1, NamedObject.class,
|
|
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
|
initEAttribute(getNamedObject_Qname(), ecorePackage.getEString(), "qname", null, 1, 1, NamedObject.class,
|
|
!IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
|
|
|
|
initEClass(primitiveEClass, Primitive.class, "Primitive", !IS_ABSTRACT, !IS_INTERFACE,
|
|
IS_GENERATED_INSTANCE_CLASS);
|
|
initEReference(getPrimitive_Type(), ecorePackage.getEObject(), null, "type", null, 1, 1, Primitive.class,
|
|
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
|
|
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
|
|
|
initEClass(linkEClass, Link.class, "Link", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
|
initEReference(getLink_ReferenceTo(), this.getComplex(), null, "referenceTo", null, 1, 1, Link.class,
|
|
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
|
|
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
|
|
|
initEClass(complexEClass, Complex.class, "Complex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
|
initEReference(getComplex_Primitives(), this.getPrimitive(), null, "primitives", null, 0, -1, Complex.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);
|
|
}
|
|
|
|
} //LossPackageImpl
|