| /** |
| * Copyright (c) 2020 CEA LIST |
| * |
| * All rights reserved. This program and the accompanying materials are |
| * made available under the terms of the Eclipse Public License v2.0 which |
| * accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| */ |
| package org.eclipse.papyrus.aiml.profile.AIML.impl; |
| |
| 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; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.*; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class AIMLFactoryImpl extends EFactoryImpl implements AIMLFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static AIMLFactory init() { |
| try { |
| AIMLFactory theAIMLFactory = (AIMLFactory)EPackage.Registry.INSTANCE.getEFactory(AIMLPackage.eNS_URI); |
| if (theAIMLFactory != null) { |
| return theAIMLFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new AIMLFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public AIMLFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case AIMLPackage.SMOOTH_L1_LOSS: return createSmoothL1Loss(); |
| case AIMLPackage.SOFT_MARGIN_LOSS: return createSoftMarginLoss(); |
| case AIMLPackage.MULTI_LABEL_SOFT_MARGIN_LOSS: return createMultiLabelSoftMarginLoss(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public SmoothL1Loss createSmoothL1Loss() { |
| SmoothL1LossImpl smoothL1Loss = new SmoothL1LossImpl(); |
| return smoothL1Loss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public SoftMarginLoss createSoftMarginLoss() { |
| SoftMarginLossImpl softMarginLoss = new SoftMarginLossImpl(); |
| return softMarginLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public MultiLabelSoftMarginLoss createMultiLabelSoftMarginLoss() { |
| MultiLabelSoftMarginLossImpl multiLabelSoftMarginLoss = new MultiLabelSoftMarginLossImpl(); |
| return multiLabelSoftMarginLoss; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public AIMLPackage getAIMLPackage() { |
| return (AIMLPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static AIMLPackage getPackage() { |
| return AIMLPackage.eINSTANCE; |
| } |
| |
| } //AIMLFactoryImpl |