/**
* generated by Xtext 2.16.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 java.math.BigDecimal;
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:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.ThresholdEntryImpl#getOperator Operator}
* - {@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.impl.ThresholdEntryImpl#getThreshold Threshold}
*
*
* @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_EQUALS;
/**
* 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 BigDecimal THRESHOLD_EDEFAULT = null;
/**
* The cached value of the '{@link #getThreshold() Threshold}' attribute.
*
*
* @see #getThreshold()
* @generated
* @ordered
*/
protected BigDecimal 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 BigDecimal getThreshold()
{
return threshold;
}
/**
*
*
* @generated
*/
@Override
public void setThreshold(BigDecimal newThreshold)
{
BigDecimal 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((BigDecimal)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_EDEFAULT == null ? threshold != null : !THRESHOLD_EDEFAULT.equals(threshold);
}
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