blob: 8cbe26eda284d86730bae84fde178f46649877a8 [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_functions;
import org.eclipse.papyrus.aiml.profile.AIML.Loss_functions.Loss_functionsPackage;
import org.eclipse.papyrus.aiml.profile.AIML.Module.impl.ModelImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Loss functions</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_functionsImpl#getReduction <em>Reduction</em>}</li>
* </ul>
*
* @generated
*/
public abstract class Loss_functionsImpl extends ModelImpl implements Loss_functions {
/**
* The default value of the '{@link #getReduction() <em>Reduction</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReduction()
* @generated
* @ordered
*/
protected static final String REDUCTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getReduction() <em>Reduction</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReduction()
* @generated
* @ordered
*/
protected String reduction = REDUCTION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Loss_functionsImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Loss_functionsPackage.Literals.LOSS_FUNCTIONS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getReduction() {
return reduction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setReduction(String newReduction) {
String oldReduction = reduction;
reduction = newReduction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Loss_functionsPackage.LOSS_FUNCTIONS__REDUCTION, oldReduction, reduction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Loss_functionsPackage.LOSS_FUNCTIONS__REDUCTION:
return getReduction();
}
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__REDUCTION:
setReduction((String)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__REDUCTION:
setReduction(REDUCTION_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__REDUCTION:
return REDUCTION_EDEFAULT == null ? reduction != null : !REDUCTION_EDEFAULT.equals(reduction);
}
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(" (reduction: "); //$NON-NLS-1$
result.append(reduction);
result.append(')');
return result.toString();
}
} //Loss_functionsImpl