blob: 0223651c3e15da1a04cba4907f452cef735901ef [file] [log] [blame]
/**
* 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.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_1;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Loss functions 11</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_1Impl#getMargin <em>Margin</em>}</li>
* </ul>
*
* @generated
*/
public class Loss_functions_1_1Impl extends Loss_functions_1Impl implements Loss_functions_1_1 {
/**
* The default value of the '{@link #getMargin() <em>Margin</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMargin()
* @generated
* @ordered
*/
protected static final double MARGIN_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getMargin() <em>Margin</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMargin()
* @generated
* @ordered
*/
protected double margin = MARGIN_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Loss_functions_1_1Impl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Loss_functionsPackage.Literals.LOSS_FUNCTIONS_11;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public double getMargin() {
return margin;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setMargin(double newMargin) {
double oldMargin = margin;
margin = newMargin;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Loss_functionsPackage.LOSS_FUNCTIONS_11__MARGIN, oldMargin, margin));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Loss_functionsPackage.LOSS_FUNCTIONS_11__MARGIN:
return getMargin();
}
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_11__MARGIN:
setMargin((Double)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_11__MARGIN:
setMargin(MARGIN_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Loss_functionsPackage.LOSS_FUNCTIONS_11__MARGIN:
return margin != MARGIN_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (margin: "); //$NON-NLS-1$
result.append(margin);
result.append(')');
return result.toString();
}
} //Loss_functions_1_1Impl