/**
* <copyright>
* </copyright>
*
* $Id$
*/
package net.sf.orcc.graph.impl;
import net.sf.orcc.graph.Edge;
import net.sf.orcc.graph.Graph;
import net.sf.orcc.graph.GraphFactory;
import net.sf.orcc.graph.GraphPackage;
import net.sf.orcc.graph.Vertex;
import net.sf.orcc.util.UtilPackage;
import net.sf.orcc.util.impl.UtilPackageImpl;
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 GraphPackageImpl extends EPackageImpl implements GraphPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass graphEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass vertexEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass edgeEClass = 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.sf.orcc.graph.GraphPackage#eNS_URI
* @see #init()
* @generated
*/
private GraphPackageImpl() {
super(eNS_URI, GraphFactory.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 GraphPackage#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 GraphPackage init() {
if (isInited)
return (GraphPackage) EPackage.Registry.INSTANCE
.getEPackage(GraphPackage.eNS_URI);
// Obtain or create and register package
GraphPackageImpl theGraphPackage = (GraphPackageImpl) (EPackage.Registry.INSTANCE
.get(eNS_URI) instanceof GraphPackageImpl ? EPackage.Registry.INSTANCE
.get(eNS_URI) : new GraphPackageImpl());
isInited = true;
// Obtain or create and register interdependencies
UtilPackageImpl theUtilPackage = (UtilPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(UtilPackage.eNS_URI) instanceof UtilPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(UtilPackage.eNS_URI) : UtilPackage.eINSTANCE);
// Create package meta-data objects
theGraphPackage.createPackageContents();
theUtilPackage.createPackageContents();
// Initialize created meta-data
theGraphPackage.initializePackageContents();
theUtilPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theGraphPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(GraphPackage.eNS_URI, theGraphPackage);
return theGraphPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getGraph() {
return graphEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getGraph_Vertices() {
return (EReference) graphEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getGraph_Edges() {
return (EReference) graphEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getVertex() {
return vertexEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getVertex_Label() {
return (EAttribute) vertexEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getVertex_Outgoing() {
return (EReference) vertexEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getVertex_Connecting() {
return (EReference) vertexEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getVertex_Predecessors() {
return (EReference) vertexEClass.getEStructuralFeatures().get(5);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getVertex_Successors() {
return (EReference) vertexEClass.getEStructuralFeatures().get(6);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getVertex_Neighbors() {
return (EReference) vertexEClass.getEStructuralFeatures().get(7);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getVertex_Number() {
return (EAttribute) vertexEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getVertex_Incoming() {
return (EReference) vertexEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getEdge() {
return edgeEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getEdge_Label() {
return (EAttribute) edgeEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getEdge_Source() {
return (EReference) edgeEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getEdge_Target() {
return (EReference) edgeEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public GraphFactory getGraphFactory() {
return (GraphFactory) 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
graphEClass = createEClass(GRAPH);
createEReference(graphEClass, GRAPH__EDGES);
createEReference(graphEClass, GRAPH__VERTICES);
vertexEClass = createEClass(VERTEX);
createEAttribute(vertexEClass, VERTEX__LABEL);
createEAttribute(vertexEClass, VERTEX__NUMBER);
createEReference(vertexEClass, VERTEX__INCOMING);
createEReference(vertexEClass, VERTEX__OUTGOING);
createEReference(vertexEClass, VERTEX__CONNECTING);
createEReference(vertexEClass, VERTEX__PREDECESSORS);
createEReference(vertexEClass, VERTEX__SUCCESSORS);
createEReference(vertexEClass, VERTEX__NEIGHBORS);
edgeEClass = createEClass(EDGE);
createEAttribute(edgeEClass, EDGE__LABEL);
createEReference(edgeEClass, EDGE__SOURCE);
createEReference(edgeEClass, EDGE__TARGET);
}
/**
* <!-- 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
UtilPackage theUtilPackage = (UtilPackage) EPackage.Registry.INSTANCE
.getEPackage(UtilPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
graphEClass.getESuperTypes().add(this.getVertex());
vertexEClass.getESuperTypes().add(theUtilPackage.getAttributable());
vertexEClass.getESuperTypes().add(theUtilPackage.getAdaptable());
edgeEClass.getESuperTypes().add(theUtilPackage.getAttributable());
// Initialize classes and features; add operations and parameters
initEClass(graphEClass, Graph.class, "Graph", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getGraph_Edges(), this.getEdge(), null, "edges", null,
0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getGraph_Vertices(), this.getVertex(), null, "vertices",
null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(vertexEClass, Vertex.class, "Vertex", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getVertex_Label(), ecorePackage.getEString(), "label",
null, 0, 1, Vertex.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEAttribute(getVertex_Number(), ecorePackage.getEInt(), "number",
null, 0, 1, Vertex.class, IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getVertex_Incoming(), this.getEdge(),
this.getEdge_Target(), "incoming", null, 0, -1, Vertex.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getVertex_Outgoing(), this.getEdge(),
this.getEdge_Source(), "outgoing", null, 0, -1, Vertex.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getVertex_Connecting(), this.getEdge(), null,
"connecting", null, 0, -1, Vertex.class, IS_TRANSIENT,
!IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED,
IS_ORDERED);
initEReference(getVertex_Predecessors(), this.getVertex(), null,
"predecessors", null, 0, -1, Vertex.class, IS_TRANSIENT,
!IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED,
IS_ORDERED);
initEReference(getVertex_Successors(), this.getVertex(), null,
"successors", null, 0, -1, Vertex.class, IS_TRANSIENT,
!IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED,
IS_ORDERED);
initEReference(getVertex_Neighbors(), this.getVertex(), null,
"neighbors", null, 0, -1, Vertex.class, IS_TRANSIENT,
!IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED,
IS_ORDERED);
initEClass(edgeEClass, Edge.class, "Edge", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getEdge_Label(), ecorePackage.getEString(), "label",
null, 0, 1, Edge.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getEdge_Source(), this.getVertex(),
this.getVertex_Outgoing(), "source", null, 0, 1, Edge.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getEdge_Target(), this.getVertex(),
this.getVertex_Incoming(), "target", null, 0, 1, Edge.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);
}
} //GraphPackageImpl