blob: 1d002f19c4a7f828dc78e6ccb09d516b08b34d69 [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.Layer_weight_constraints.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.Layer_weight_constraints.Layer_weight_constraintsPackage;
import org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_constraints.NormWithMaxValue;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Norm With Max Value</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.aiml.profile.AIML.Layer_weight_constraints.impl.NormWithMaxValueImpl#getMax_value <em>Max value</em>}</li>
* </ul>
*
* @generated
*/
public abstract class NormWithMaxValueImpl extends normImpl implements NormWithMaxValue {
/**
* The default value of the '{@link #getMax_value() <em>Max value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax_value()
* @generated
* @ordered
*/
protected static final double MAX_VALUE_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getMax_value() <em>Max value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax_value()
* @generated
* @ordered
*/
protected double max_value = MAX_VALUE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected NormWithMaxValueImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Layer_weight_constraintsPackage.Literals.NORM_WITH_MAX_VALUE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public double getMax_value() {
return max_value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setMax_value(double newMax_value) {
double oldMax_value = max_value;
max_value = newMax_value;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Layer_weight_constraintsPackage.NORM_WITH_MAX_VALUE__MAX_VALUE, oldMax_value, max_value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Layer_weight_constraintsPackage.NORM_WITH_MAX_VALUE__MAX_VALUE:
return getMax_value();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Layer_weight_constraintsPackage.NORM_WITH_MAX_VALUE__MAX_VALUE:
setMax_value((Double)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Layer_weight_constraintsPackage.NORM_WITH_MAX_VALUE__MAX_VALUE:
setMax_value(MAX_VALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Layer_weight_constraintsPackage.NORM_WITH_MAX_VALUE__MAX_VALUE:
return max_value != MAX_VALUE_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(" (max_value: "); //$NON-NLS-1$
result.append(max_value);
result.append(')');
return result.toString();
}
} //NormWithMaxValueImpl