/** * Copyright (c) 2012-2016 Marsha Chechik, Alessio Di Sandro, Michalis Famelis, * Rick Salay. * 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: * Alessio Di Sandro - Implementation. */ package edu.toronto.cs.se.modelepedia.tutorial.state.impl; import edu.toronto.cs.se.modelepedia.tutorial.state.*; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class StateFactoryImpl extends EFactoryImpl implements StateFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static StateFactory init() { try { StateFactory theStateFactory = (StateFactory)EPackage.Registry.INSTANCE.getEFactory(StatePackage.eNS_URI); if (theStateFactory != null) { return theStateFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new StateFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public StateFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case StatePackage.STATE: return createState(); case StatePackage.REGION: return createRegion(); case StatePackage.CITY: return createCity(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public State createState() { StateImpl state = new StateImpl(); return state; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Region createRegion() { RegionImpl region = new RegionImpl(); return region; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public City createCity() { CityImpl city = new CityImpl(); return city; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public StatePackage getStatePackage() { return (StatePackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static StatePackage getPackage() { return StatePackage.eINSTANCE; } } //StateFactoryImpl