fr.lip6.move.pnml.symmetricnet.finiteEnumerations.impl.FiniteEnumerationsPackageImpl Maven / Gradle / Ivy
/**
* Copyright 2009-2016 Université Paris Ouest and Sorbonne Universités,
* Univ. Paris 06 - CNRS UMR 7606 (LIP6)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Project leader / Initial Contributor:
* Lom Messan Hillah -
*
* Contributors:
* ${ocontributors} - <$oemails}>
*
* Mailing list:
* [email protected]
*/
/**
* (C) Sorbonne Universités, UPMC Univ Paris 06, UMR CNRS 7606 (LIP6/MoVe)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Lom HILLAH (LIP6) - Initial models and implementation
* Rachid Alahyane (UPMC) - Infrastructure and continuous integration
* Bastien Bouzerau (UPMC) - Architecture
* Guillaume Giffo (UPMC) - Code generation refactoring, High-level API
*/
package fr.lip6.move.pnml.symmetricnet.finiteEnumerations.impl;
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 fr.lip6.move.pnml.symmetricnet.booleans.BooleansPackage;
import fr.lip6.move.pnml.symmetricnet.booleans.impl.BooleansPackageImpl;
import fr.lip6.move.pnml.symmetricnet.cyclicEnumerations.CyclicEnumerationsPackage;
import fr.lip6.move.pnml.symmetricnet.cyclicEnumerations.impl.CyclicEnumerationsPackageImpl;
import fr.lip6.move.pnml.symmetricnet.dots.DotsPackage;
import fr.lip6.move.pnml.symmetricnet.dots.impl.DotsPackageImpl;
import fr.lip6.move.pnml.symmetricnet.finiteEnumerations.FEConstant;
import fr.lip6.move.pnml.symmetricnet.finiteEnumerations.FiniteEnumeration;
import fr.lip6.move.pnml.symmetricnet.finiteEnumerations.FiniteEnumerationsFactory;
import fr.lip6.move.pnml.symmetricnet.finiteEnumerations.FiniteEnumerationsPackage;
import fr.lip6.move.pnml.symmetricnet.finiteIntRanges.FiniteIntRangesPackage;
import fr.lip6.move.pnml.symmetricnet.finiteIntRanges.impl.FiniteIntRangesPackageImpl;
import fr.lip6.move.pnml.symmetricnet.hlcorestructure.HlcorestructurePackage;
import fr.lip6.move.pnml.symmetricnet.hlcorestructure.impl.HlcorestructurePackageImpl;
import fr.lip6.move.pnml.symmetricnet.integers.IntegersPackage;
import fr.lip6.move.pnml.symmetricnet.integers.impl.IntegersPackageImpl;
import fr.lip6.move.pnml.symmetricnet.multisets.MultisetsPackage;
import fr.lip6.move.pnml.symmetricnet.multisets.impl.MultisetsPackageImpl;
import fr.lip6.move.pnml.symmetricnet.partitions.PartitionsPackage;
import fr.lip6.move.pnml.symmetricnet.partitions.impl.PartitionsPackageImpl;
import fr.lip6.move.pnml.symmetricnet.terms.TermsPackage;
import fr.lip6.move.pnml.symmetricnet.terms.impl.TermsPackageImpl;
/**
*
* An implementation of the model Package.
*
* @generated
*/
public class FiniteEnumerationsPackageImpl extends EPackageImpl implements FiniteEnumerationsPackage {
/**
*
*
* @generated
*/
private EClass finiteEnumerationEClass = null;
/**
*
*
* @generated
*/
private EClass feConstantEClass = null;
/**
* Creates an instance of the model Package, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* 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.
*
*
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see fr.lip6.move.pnml.symmetricnet.finiteEnumerations.FiniteEnumerationsPackage#eNS_URI
* @see #init()
* @generated
*/
private FiniteEnumerationsPackageImpl() {
super(eNS_URI, FiniteEnumerationsFactory.eINSTANCE);
}
/**
*
*
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the Package for this model, and for any others upon which it depends.
*
*
This method is used to initialize {@link FiniteEnumerationsPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
*
*
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static FiniteEnumerationsPackage init() {
if (isInited)
return (FiniteEnumerationsPackage) EPackage.Registry.INSTANCE
.getEPackage(FiniteEnumerationsPackage.eNS_URI);
// Obtain or create and register package
FiniteEnumerationsPackageImpl theFiniteEnumerationsPackage = (FiniteEnumerationsPackageImpl) (EPackage.Registry.INSTANCE
.get(eNS_URI) instanceof FiniteEnumerationsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
: new FiniteEnumerationsPackageImpl());
isInited = true;
// Obtain or create and register interdependencies
BooleansPackageImpl theBooleansPackage = (BooleansPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(BooleansPackage.eNS_URI) instanceof BooleansPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(BooleansPackage.eNS_URI) : BooleansPackage.eINSTANCE);
CyclicEnumerationsPackageImpl theCyclicEnumerationsPackage = (CyclicEnumerationsPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(CyclicEnumerationsPackage.eNS_URI) instanceof CyclicEnumerationsPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(CyclicEnumerationsPackage.eNS_URI) : CyclicEnumerationsPackage.eINSTANCE);
DotsPackageImpl theDotsPackage = (DotsPackageImpl) (EPackage.Registry.INSTANCE.getEPackage(DotsPackage.eNS_URI) instanceof DotsPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(DotsPackage.eNS_URI) : DotsPackage.eINSTANCE);
FiniteIntRangesPackageImpl theFiniteIntRangesPackage = (FiniteIntRangesPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(FiniteIntRangesPackage.eNS_URI) instanceof FiniteIntRangesPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(FiniteIntRangesPackage.eNS_URI) : FiniteIntRangesPackage.eINSTANCE);
HlcorestructurePackageImpl theHlcorestructurePackage = (HlcorestructurePackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(HlcorestructurePackage.eNS_URI) instanceof HlcorestructurePackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(HlcorestructurePackage.eNS_URI) : HlcorestructurePackage.eINSTANCE);
IntegersPackageImpl theIntegersPackage = (IntegersPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(IntegersPackage.eNS_URI) instanceof IntegersPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(IntegersPackage.eNS_URI) : IntegersPackage.eINSTANCE);
MultisetsPackageImpl theMultisetsPackage = (MultisetsPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(MultisetsPackage.eNS_URI) instanceof MultisetsPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(MultisetsPackage.eNS_URI) : MultisetsPackage.eINSTANCE);
PartitionsPackageImpl thePartitionsPackage = (PartitionsPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(PartitionsPackage.eNS_URI) instanceof PartitionsPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(PartitionsPackage.eNS_URI) : PartitionsPackage.eINSTANCE);
TermsPackageImpl theTermsPackage = (TermsPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(TermsPackage.eNS_URI) instanceof TermsPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(TermsPackage.eNS_URI) : TermsPackage.eINSTANCE);
// Create package meta-data objects
theFiniteEnumerationsPackage.createPackageContents();
theBooleansPackage.createPackageContents();
theCyclicEnumerationsPackage.createPackageContents();
theDotsPackage.createPackageContents();
theFiniteIntRangesPackage.createPackageContents();
theHlcorestructurePackage.createPackageContents();
theIntegersPackage.createPackageContents();
theMultisetsPackage.createPackageContents();
thePartitionsPackage.createPackageContents();
theTermsPackage.createPackageContents();
// Initialize created meta-data
theFiniteEnumerationsPackage.initializePackageContents();
theBooleansPackage.initializePackageContents();
theCyclicEnumerationsPackage.initializePackageContents();
theDotsPackage.initializePackageContents();
theFiniteIntRangesPackage.initializePackageContents();
theHlcorestructurePackage.initializePackageContents();
theIntegersPackage.initializePackageContents();
theMultisetsPackage.initializePackageContents();
thePartitionsPackage.initializePackageContents();
theTermsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theFiniteEnumerationsPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(FiniteEnumerationsPackage.eNS_URI, theFiniteEnumerationsPackage);
return theFiniteEnumerationsPackage;
}
/**
*
*
* @generated
*/
public EClass getFiniteEnumeration() {
return finiteEnumerationEClass;
}
/**
*
*
* @generated
*/
public EReference getFiniteEnumeration_Elements() {
return (EReference) finiteEnumerationEClass.getEStructuralFeatures().get(0);
}
/**
*
*
* @generated
*/
public EClass getFEConstant() {
return feConstantEClass;
}
/**
*
*
* @generated
*/
public EReference getFEConstant_Sort() {
return (EReference) feConstantEClass.getEStructuralFeatures().get(0);
}
/**
*
*
* @generated
*/
public FiniteEnumerationsFactory getFiniteEnumerationsFactory() {
return (FiniteEnumerationsFactory) getEFactoryInstance();
}
/**
*
*
* @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.
*
*
* @generated
*/
public void createPackageContents() {
if (isCreated)
return;
isCreated = true;
// Create classes and their features
finiteEnumerationEClass = createEClass(FINITE_ENUMERATION);
createEReference(finiteEnumerationEClass, FINITE_ENUMERATION__ELEMENTS);
feConstantEClass = createEClass(FE_CONSTANT);
createEReference(feConstantEClass, FE_CONSTANT__SORT);
}
/**
*
*
* @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.
*
*
* @generated
*/
public void initializePackageContents() {
if (isInitialized)
return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
TermsPackage theTermsPackage = (TermsPackage) EPackage.Registry.INSTANCE.getEPackage(TermsPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
finiteEnumerationEClass.getESuperTypes().add(theTermsPackage.getBuiltInSort());
feConstantEClass.getESuperTypes().add(theTermsPackage.getOperatorDecl());
// Initialize classes and features; add operations and parameters
initEClass(finiteEnumerationEClass, FiniteEnumeration.class, "FiniteEnumeration", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEReference(getFiniteEnumeration_Elements(), this.getFEConstant(), this.getFEConstant_Sort(), "elements",
null, 0, -1, FiniteEnumeration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(feConstantEClass, FEConstant.class, "FEConstant", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEReference(getFEConstant_Sort(), this.getFiniteEnumeration(), this.getFiniteEnumeration_Elements(), "sort",
null, 1, 1, FEConstant.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);
// Create annotations
// http://www.pnml.org/models/ToPNML
createToPNMLAnnotations();
// http://www.pnml.org/models/HLAPI
createHLAPIAnnotations();
// http://www.pnml.org/models/methods/SORT
createSORTAnnotations();
}
/**
* Initializes the annotations for http://www.pnml.org/models/ToPNML.
*
*
* @generated
*/
protected void createToPNMLAnnotations() {
String source = "http://www.pnml.org/models/ToPNML";
addAnnotation(finiteEnumerationEClass, source, new String[] { "tag", "finiteenumeration", "kind", "son" });
addAnnotation(getFiniteEnumeration_Elements(), source, new String[] { "kind", "follow" });
addAnnotation(feConstantEClass, source, new String[] { "tag", "feconstant", "kind", "son" });
}
/**
* Initializes the annotations for http://www.pnml.org/models/HLAPI.
*
*
* @generated
*/
protected void createHLAPIAnnotations() {
String source = "http://www.pnml.org/models/HLAPI";
addAnnotation(finiteEnumerationEClass, source, new String[] {});
addAnnotation(feConstantEClass, source, new String[] {});
}
/**
* Initializes the annotations for http://www.pnml.org/models/methods/SORT.
*
*
* @generated
*/
protected void createSORTAnnotations() {
String source = "http://www.pnml.org/models/methods/SORT";
addAnnotation(
finiteEnumerationEClass,
source,
new String[] {
"signature",
"boolean equalSorts(Sort sort)",
"body",
"boolean isEqual = false;\n\t\tif (this.eClass().getName().equalsIgnoreCase(sort.eClass().getName())) {\n\t\t\tif (this.getContainerNamedSort() != null\n\t\t\t\t\t&& sort.getContainerNamedSort() != null) {\n\t\t\t\tisEqual = this.getContainerNamedSort().getName()\n\t\t\t\t\t\t.equalsIgnoreCase(\n\t\t\t\t\t\t\t\tsort.getContainerNamedSort().getName());\n\t\t\t} else {\n\t\t\t\tif (\"FiniteEnumeration\".equalsIgnoreCase(this.eClass().getName())) {\n\t\t\t\t\tFiniteEnumeration myFE = (FiniteEnumeration) this;\n\t\t\t\t\tFiniteEnumeration thatFE = (FiniteEnumeration) sort;\n\t\t\t\t\tList myConstants = myFE.getElements();\n\t\t\t\t\tList thoseConstants = thatFE.getElements();\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\t\n\t\t\t\t\tfor (; i < myConstants.size() && j < thoseConstants.size(); i++, j++) {\n\t\t\t\t\t\tif (myConstants\n\t\t\t\t\t\t\t\t.get(i)\n\t\t\t\t\t\t\t\t.getName()\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(\n\t\t\t\t\t\t\t\t\t\tthoseConstants.get(j).getName())) {\n\t\t\t\t\t\t\tisEqual = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisEqual = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn isEqual;",
"documentation",
"/**\n * Returns true if this sort and argument sort are actually \n * semantically the same sort, even in two different objects.\n * Ex: two FiniteEnumerations or two Integers.\n * @return true if so. \n * @param sort the sort to which we compare this one. \n */" });
}
} //FiniteEnumerationsPackageImpl