/** * generated by Xtext 2.21.0 */ package hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl; import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage; import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ComparisonOperator; import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ThresholdEntry; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * * An implementation of the model object 'Threshold Entry'. * *

* The following features are implemented: *

* * * @generated */ public class ThresholdEntryImpl extends ObjectiveEntryImpl implements ThresholdEntry { /** * The default value of the '{@link #getOperator() Operator}' attribute. * * * @see #getOperator() * @generated * @ordered */ protected static final ComparisonOperator OPERATOR_EDEFAULT = ComparisonOperator.LESS; /** * The cached value of the '{@link #getOperator() Operator}' attribute. * * * @see #getOperator() * @generated * @ordered */ protected ComparisonOperator operator = OPERATOR_EDEFAULT; /** * The default value of the '{@link #getThreshold() Threshold}' attribute. * * * @see #getThreshold() * @generated * @ordered */ protected static final double THRESHOLD_EDEFAULT = 0.0; /** * The cached value of the '{@link #getThreshold() Threshold}' attribute. * * * @see #getThreshold() * @generated * @ordered */ protected double threshold = THRESHOLD_EDEFAULT; /** * * * @generated */ protected ThresholdEntryImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return ApplicationConfigurationPackage.Literals.THRESHOLD_ENTRY; } /** * * * @generated */ @Override public ComparisonOperator getOperator() { return operator; } /** * * * @generated */ @Override public void setOperator(ComparisonOperator newOperator) { ComparisonOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.THRESHOLD_ENTRY__OPERATOR, oldOperator, operator)); } /** * * * @generated */ @Override public double getThreshold() { return threshold; } /** * * * @generated */ @Override public void setThreshold(double newThreshold) { double oldThreshold = threshold; threshold = newThreshold; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ApplicationConfigurationPackage.THRESHOLD_ENTRY__THRESHOLD, oldThreshold, threshold)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ApplicationConfigurationPackage.THRESHOLD_ENTRY__OPERATOR: return getOperator(); case ApplicationConfigurationPackage.THRESHOLD_ENTRY__THRESHOLD: return getThreshold(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ApplicationConfigurationPackage.THRESHOLD_ENTRY__OPERATOR: setOperator((ComparisonOperator)newValue); return; case ApplicationConfigurationPackage.THRESHOLD_ENTRY__THRESHOLD: setThreshold((Double)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ApplicationConfigurationPackage.THRESHOLD_ENTRY__OPERATOR: setOperator(OPERATOR_EDEFAULT); return; case ApplicationConfigurationPackage.THRESHOLD_ENTRY__THRESHOLD: setThreshold(THRESHOLD_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ApplicationConfigurationPackage.THRESHOLD_ENTRY__OPERATOR: return operator != OPERATOR_EDEFAULT; case ApplicationConfigurationPackage.THRESHOLD_ENTRY__THRESHOLD: return threshold != THRESHOLD_EDEFAULT; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (operator: "); result.append(operator); result.append(", threshold: "); result.append(threshold); result.append(')'); return result.toString(); } } //ThresholdEntryImpl