/**
*/
package org.eclipse.gmf.tooling.examples.phantoms.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 org.eclipse.gmf.tooling.examples.phantoms.Medium;
import org.eclipse.gmf.tooling.examples.phantoms.MediumChild;
import org.eclipse.gmf.tooling.examples.phantoms.MediumParent;
import org.eclipse.gmf.tooling.examples.phantoms.PhantomsFactory;
import org.eclipse.gmf.tooling.examples.phantoms.PhantomsPackage;
import org.eclipse.gmf.tooling.examples.phantoms.Root;
import org.eclipse.gmf.tooling.examples.phantoms.RootChild;
import org.eclipse.gmf.tooling.examples.phantoms.TopChild;
import org.eclipse.gmf.tooling.examples.phantoms.TopParent;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class PhantomsPackageImpl extends EPackageImpl implements PhantomsPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass rootEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass rootChildEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass topParentEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass mediumEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass topChildEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass mediumParentEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass mediumChildEClass = 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.gmf.tooling.examples.phantoms.PhantomsPackage#eNS_URI
* @see #init()
* @generated
*/
private PhantomsPackageImpl() {
super(eNS_URI, PhantomsFactory.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 PhantomsPackage#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 PhantomsPackage init() {
if (isInited) return (PhantomsPackage)EPackage.Registry.INSTANCE.getEPackage(PhantomsPackage.eNS_URI);
// Obtain or create and register package
PhantomsPackageImpl thePhantomsPackage = (PhantomsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PhantomsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PhantomsPackageImpl());
isInited = true;
// Create package meta-data objects
thePhantomsPackage.createPackageContents();
// Initialize created meta-data
thePhantomsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
thePhantomsPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(PhantomsPackage.eNS_URI, thePhantomsPackage);
return thePhantomsPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getRoot() {
return rootEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRoot_Children() {
return (EReference)rootEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getRootChild() {
return rootChildEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTopParent() {
return topParentEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getTopParent_Children() {
return (EReference)topParentEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getMedium() {
return mediumEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getMedium_Children() {
return (EReference)mediumEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTopChild() {
return topChildEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getTopChild_Name() {
return (EAttribute)topChildEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getMediumParent() {
return mediumParentEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getMediumParent_Children() {
return (EReference)mediumParentEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getMediumChild() {
return mediumChildEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getMediumChild_Name() {
return (EAttribute)mediumChildEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PhantomsFactory getPhantomsFactory() {
return (PhantomsFactory)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
rootEClass = createEClass(ROOT);
createEReference(rootEClass, ROOT__CHILDREN);
rootChildEClass = createEClass(ROOT_CHILD);
topParentEClass = createEClass(TOP_PARENT);
createEReference(topParentEClass, TOP_PARENT__CHILDREN);
mediumEClass = createEClass(MEDIUM);
createEReference(mediumEClass, MEDIUM__CHILDREN);
topChildEClass = createEClass(TOP_CHILD);
createEAttribute(topChildEClass, TOP_CHILD__NAME);
mediumParentEClass = createEClass(MEDIUM_PARENT);
createEReference(mediumParentEClass, MEDIUM_PARENT__CHILDREN);
mediumChildEClass = createEClass(MEDIUM_CHILD);
createEAttribute(mediumChildEClass, MEDIUM_CHILD__NAME);
}
/**
* <!-- 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
topParentEClass.getESuperTypes().add(this.getRootChild());
mediumEClass.getESuperTypes().add(this.getRootChild());
// Initialize classes, features, and operations; add parameters
initEClass(rootEClass, Root.class, "Root", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getRoot_Children(), this.getRootChild(), null, "children", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(rootChildEClass, RootChild.class, "RootChild", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(topParentEClass, TopParent.class, "TopParent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getTopParent_Children(), this.getTopChild(), null, "children", null, 0, -1, TopParent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(mediumEClass, Medium.class, "Medium", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getMedium_Children(), this.getMediumParent(), null, "children", null, 0, -1, Medium.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(topChildEClass, TopChild.class, "TopChild", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getTopChild_Name(), ecorePackage.getEString(), "name", "TopChild", 0, 1, TopChild.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(mediumParentEClass, MediumParent.class, "MediumParent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getMediumParent_Children(), this.getMediumChild(), null, "children", null, 0, -1, MediumParent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(mediumChildEClass, MediumChild.class, "MediumChild", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getMediumChild_Name(), ecorePackage.getEString(), "name", "MediumChild", 0, 1, MediumChild.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
} //PhantomsPackageImpl