blob: 11a98116117a37fff682ec35b8fb764a7d79c557 [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.NonLinearActivations.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.NonLinearActivations.ELU;
import org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.NonLinearActivationsPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>ELU</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.impl.ELUImpl#getAlpha <em>Alpha</em>}</li>
* </ul>
*
* @generated
*/
public class ELUImpl extends Nonlinear_activations_weightedsumnonlinearity_1Impl implements ELU {
/**
* The default value of the '{@link #getAlpha() <em>Alpha</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlpha()
* @generated
* @ordered
*/
protected static final double ALPHA_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getAlpha() <em>Alpha</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlpha()
* @generated
* @ordered
*/
protected double alpha = ALPHA_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ELUImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return NonLinearActivationsPackage.Literals.ELU;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public double getAlpha() {
return alpha;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setAlpha(double newAlpha) {
double oldAlpha = alpha;
alpha = newAlpha;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NonLinearActivationsPackage.ELU__ALPHA, oldAlpha, alpha));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case NonLinearActivationsPackage.ELU__ALPHA:
return getAlpha();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case NonLinearActivationsPackage.ELU__ALPHA:
setAlpha((Double)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case NonLinearActivationsPackage.ELU__ALPHA:
setAlpha(ALPHA_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case NonLinearActivationsPackage.ELU__ALPHA:
return alpha != ALPHA_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(" (alpha: "); //$NON-NLS-1$
result.append(alpha);
result.append(')');
return result.toString();
}
} //ELUImpl