| /** |
| * 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.Loss_functions.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.Loss_functionsPackage; |
| import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.Loss_functions_1_2; |
| |
| import org.eclipse.papyrus.aiml.profile.AIML.Tensor.Tensor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Loss functions 12</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.impl.Loss_functions_1_2Impl#getWeight <em>Weight</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class Loss_functions_1_2Impl extends Loss_functions_1Impl implements Loss_functions_1_2 { |
| /** |
| * The cached value of the '{@link #getWeight() <em>Weight</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getWeight() |
| * @generated |
| * @ordered |
| */ |
| protected Tensor weight; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected Loss_functions_1_2Impl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Loss_functionsPackage.Literals.LOSS_FUNCTIONS_12; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Tensor getWeight() { |
| if (weight != null && weight.eIsProxy()) { |
| InternalEObject oldWeight = (InternalEObject)weight; |
| weight = (Tensor)eResolveProxy(oldWeight); |
| if (weight != oldWeight) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, Loss_functionsPackage.LOSS_FUNCTIONS_12__WEIGHT, oldWeight, weight)); |
| } |
| } |
| return weight; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Tensor basicGetWeight() { |
| return weight; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setWeight(Tensor newWeight) { |
| Tensor oldWeight = weight; |
| weight = newWeight; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Loss_functionsPackage.LOSS_FUNCTIONS_12__WEIGHT, oldWeight, weight)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Loss_functionsPackage.LOSS_FUNCTIONS_12__WEIGHT: |
| if (resolve) return getWeight(); |
| return basicGetWeight(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Loss_functionsPackage.LOSS_FUNCTIONS_12__WEIGHT: |
| setWeight((Tensor)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Loss_functionsPackage.LOSS_FUNCTIONS_12__WEIGHT: |
| setWeight((Tensor)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Loss_functionsPackage.LOSS_FUNCTIONS_12__WEIGHT: |
| return weight != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //Loss_functions_1_2Impl |