blob: 7244beea2c537c5cfb4e69dddcdd1db8076b3598 [file] [log] [blame]
package org.eclipse.stem.interventions.impl;
/*******************************************************************************
* Copyright (c) 2011 IBM Corporation and others.
* 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:
* IBM Corporation - initial API and implementation
*******************************************************************************/
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.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.stem.core.common.CommonPackage;
import org.eclipse.stem.core.graph.GraphPackage;
import org.eclipse.stem.core.model.ModelPackage;
import org.eclipse.stem.core.modifier.ModifierPackage;
import org.eclipse.stem.core.predicate.PredicatePackage;
import org.eclipse.stem.graphgenerators.GraphgeneratorsPackage;
import org.eclipse.stem.core.scenario.ScenarioPackage;
import org.eclipse.stem.core.sequencer.SequencerPackage;
import org.eclipse.stem.core.solver.SolverPackage;
import org.eclipse.stem.interventions.ControlGraphGenerator;
import org.eclipse.stem.interventions.InterventionLabel;
import org.eclipse.stem.interventions.InterventionLabelValue;
import org.eclipse.stem.interventions.InterventionsFactory;
import org.eclipse.stem.interventions.InterventionsPackage;
import org.eclipse.stem.interventions.StandardInterventionLabel;
import org.eclipse.stem.interventions.StandardInterventionLabelValue;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class InterventionsPackageImpl extends EPackageImpl implements InterventionsPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass interventionLabelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass standardInterventionLabelEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass controlGraphGeneratorEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass interventionLabelValueEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass standardInterventionLabelValueEClass = 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 org.eclipse.stem.interventions.InterventionsPackage#eNS_URI
* @see #init()
* @generated
*/
private InterventionsPackageImpl() {
super(eNS_URI, InterventionsFactory.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 InterventionsPackage#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 InterventionsPackage init() {
if (isInited) return (InterventionsPackage)EPackage.Registry.INSTANCE.getEPackage(InterventionsPackage.eNS_URI);
// Obtain or create and register package
InterventionsPackageImpl theInterventionsPackage = (InterventionsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof InterventionsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new InterventionsPackageImpl());
isInited = true;
// Initialize simple dependencies
PredicatePackage.eINSTANCE.eClass();
GraphgeneratorsPackage.eINSTANCE.eClass();
// Create package meta-data objects
theInterventionsPackage.createPackageContents();
// Initialize created meta-data
theInterventionsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theInterventionsPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(InterventionsPackage.eNS_URI, theInterventionsPackage);
return theInterventionsPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getInterventionLabel() {
return interventionLabelEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getStandardInterventionLabel() {
return standardInterventionLabelEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getStandardInterventionLabel_PopulationIdentifier() {
return (EAttribute)standardInterventionLabelEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getControlGraphGenerator() {
return controlGraphGeneratorEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getControlGraphGenerator_VaccinationFraction() {
return (EAttribute)controlGraphGeneratorEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getControlGraphGenerator_IsolationFraction() {
return (EAttribute)controlGraphGeneratorEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getControlGraphGenerator_PopulationIdentifier() {
return (EAttribute)controlGraphGeneratorEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getControlGraphGenerator_Location() {
return (EAttribute)controlGraphGeneratorEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getInterventionLabelValue() {
return interventionLabelValueEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getStandardInterventionLabelValue() {
return standardInterventionLabelValueEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getStandardInterventionLabelValue_Vaccinations() {
return (EAttribute)standardInterventionLabelValueEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getStandardInterventionLabelValue_Isolations() {
return (EAttribute)standardInterventionLabelValueEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InterventionsFactory getInterventionsFactory() {
return (InterventionsFactory)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
interventionLabelEClass = createEClass(INTERVENTION_LABEL);
standardInterventionLabelEClass = createEClass(STANDARD_INTERVENTION_LABEL);
createEAttribute(standardInterventionLabelEClass, STANDARD_INTERVENTION_LABEL__POPULATION_IDENTIFIER);
controlGraphGeneratorEClass = createEClass(CONTROL_GRAPH_GENERATOR);
createEAttribute(controlGraphGeneratorEClass, CONTROL_GRAPH_GENERATOR__VACCINATION_FRACTION);
createEAttribute(controlGraphGeneratorEClass, CONTROL_GRAPH_GENERATOR__ISOLATION_FRACTION);
createEAttribute(controlGraphGeneratorEClass, CONTROL_GRAPH_GENERATOR__POPULATION_IDENTIFIER);
createEAttribute(controlGraphGeneratorEClass, CONTROL_GRAPH_GENERATOR__LOCATION);
interventionLabelValueEClass = createEClass(INTERVENTION_LABEL_VALUE);
standardInterventionLabelValueEClass = createEClass(STANDARD_INTERVENTION_LABEL_VALUE);
createEAttribute(standardInterventionLabelValueEClass, STANDARD_INTERVENTION_LABEL_VALUE__VACCINATIONS);
createEAttribute(standardInterventionLabelValueEClass, STANDARD_INTERVENTION_LABEL_VALUE__ISOLATIONS);
}
/**
* <!-- 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
GraphPackage theGraphPackage = (GraphPackage)EPackage.Registry.INSTANCE.getEPackage(GraphPackage.eNS_URI);
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
GraphgeneratorsPackage theGraphgeneratorsPackage = (GraphgeneratorsPackage)EPackage.Registry.INSTANCE.getEPackage(GraphgeneratorsPackage.eNS_URI);
CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
interventionLabelEClass.getESuperTypes().add(theGraphPackage.getStaticNodeLabel());
standardInterventionLabelEClass.getESuperTypes().add(this.getInterventionLabel());
controlGraphGeneratorEClass.getESuperTypes().add(theGraphgeneratorsPackage.getGraphGenerator());
interventionLabelValueEClass.getESuperTypes().add(theGraphPackage.getLabelValue());
standardInterventionLabelValueEClass.getESuperTypes().add(this.getInterventionLabelValue());
// Initialize classes and features; add operations and parameters
initEClass(interventionLabelEClass, InterventionLabel.class, "InterventionLabel", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(standardInterventionLabelEClass, StandardInterventionLabel.class, "StandardInterventionLabel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getStandardInterventionLabel_PopulationIdentifier(), theEcorePackage.getEString(), "populationIdentifier", "human", 0, 1, StandardInterventionLabel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(controlGraphGeneratorEClass, ControlGraphGenerator.class, "ControlGraphGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getControlGraphGenerator_VaccinationFraction(), theEcorePackage.getEDouble(), "vaccinationFraction", "0.0", 0, 1, ControlGraphGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getControlGraphGenerator_IsolationFraction(), theEcorePackage.getEDouble(), "isolationFraction", "0.0", 0, 1, ControlGraphGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getControlGraphGenerator_PopulationIdentifier(), theEcorePackage.getEString(), "populationIdentifier", "human", 0, 1, ControlGraphGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getControlGraphGenerator_Location(), theCommonPackage.getURI(), "location", null, 0, 1, ControlGraphGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(interventionLabelValueEClass, InterventionLabelValue.class, "InterventionLabelValue", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(standardInterventionLabelValueEClass, StandardInterventionLabelValue.class, "StandardInterventionLabelValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getStandardInterventionLabelValue_Vaccinations(), theEcorePackage.getEDouble(), "vaccinations", null, 0, 1, StandardInterventionLabelValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getStandardInterventionLabelValue_Isolations(), theEcorePackage.getEDouble(), "isolations", null, 0, 1, StandardInterventionLabelValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
} //InterventionsPackageImpl