blob: 63ba57c39fdb72a7a0f649d29dbd244a5d28f225 [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.NonLinearActivationsPackage;
import org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.RReLU;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>RRe LU</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.impl.RReLUImpl#getLower <em>Lower</em>}</li>
* <li>{@link org.eclipse.papyrus.aiml.profile.AIML.NonLinearActivations.impl.RReLUImpl#getUpper <em>Upper</em>}</li>
* </ul>
*
* @generated
*/
public class RReLUImpl extends Nonlinear_activations_weightedsumnonlinearity_1Impl implements RReLU {
/**
* The default value of the '{@link #getLower() <em>Lower</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLower()
* @generated
* @ordered
*/
protected static final double LOWER_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getLower() <em>Lower</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLower()
* @generated
* @ordered
*/
protected double lower = LOWER_EDEFAULT;
/**
* The default value of the '{@link #getUpper() <em>Upper</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUpper()
* @generated
* @ordered
*/
protected static final double UPPER_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getUpper() <em>Upper</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUpper()
* @generated
* @ordered
*/
protected double upper = UPPER_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RReLUImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return NonLinearActivationsPackage.Literals.RRE_LU;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public double getLower() {
return lower;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setLower(double newLower) {
double oldLower = lower;
lower = newLower;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NonLinearActivationsPackage.RRE_LU__LOWER, oldLower, lower));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public double getUpper() {
return upper;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setUpper(double newUpper) {
double oldUpper = upper;
upper = newUpper;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NonLinearActivationsPackage.RRE_LU__UPPER, oldUpper, upper));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case NonLinearActivationsPackage.RRE_LU__LOWER:
return getLower();
case NonLinearActivationsPackage.RRE_LU__UPPER:
return getUpper();
}
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.RRE_LU__LOWER:
setLower((Double)newValue);
return;
case NonLinearActivationsPackage.RRE_LU__UPPER:
setUpper((Double)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case NonLinearActivationsPackage.RRE_LU__LOWER:
setLower(LOWER_EDEFAULT);
return;
case NonLinearActivationsPackage.RRE_LU__UPPER:
setUpper(UPPER_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case NonLinearActivationsPackage.RRE_LU__LOWER:
return lower != LOWER_EDEFAULT;
case NonLinearActivationsPackage.RRE_LU__UPPER:
return upper != UPPER_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(" (lower: "); //$NON-NLS-1$
result.append(lower);
result.append(", upper: "); //$NON-NLS-1$
result.append(upper);
result.append(')');
return result.toString();
}
} //RReLUImpl