org.jboss.drools.impl.DistributionParameterImpl Maven / Gradle / Ivy
/**
*/
package org.jboss.drools.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.jboss.drools.DistributionParameter;
import org.jboss.drools.DroolsPackage;
/**
*
* An implementation of the model object 'Distribution Parameter'.
*
*
* The following features are implemented:
*
* - {@link org.jboss.drools.impl.DistributionParameterImpl#isDiscrete Discrete}
*
*
*
* @generated
*/
public class DistributionParameterImpl extends ParameterValueImpl implements DistributionParameter {
/**
* The default value of the '{@link #isDiscrete() Discrete}' attribute.
*
*
* @see #isDiscrete()
* @generated
* @ordered
*/
protected static final boolean DISCRETE_EDEFAULT = false;
/**
* The cached value of the '{@link #isDiscrete() Discrete}' attribute.
*
*
* @see #isDiscrete()
* @generated
* @ordered
*/
protected boolean discrete = DISCRETE_EDEFAULT;
/**
* This is true if the Discrete attribute has been set.
*
*
* @generated
* @ordered
*/
protected boolean discreteESet;
/**
*
*
* @generated
*/
protected DistributionParameterImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DroolsPackage.Literals.DISTRIBUTION_PARAMETER;
}
/**
*
*
* @generated
*/
public boolean isDiscrete() {
return discrete;
}
/**
*
*
* @generated
*/
public void setDiscrete(boolean newDiscrete) {
boolean oldDiscrete = discrete;
discrete = newDiscrete;
boolean oldDiscreteESet = discreteESet;
discreteESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DroolsPackage.DISTRIBUTION_PARAMETER__DISCRETE, oldDiscrete, discrete, !oldDiscreteESet));
}
/**
*
*
* @generated
*/
public void unsetDiscrete() {
boolean oldDiscrete = discrete;
boolean oldDiscreteESet = discreteESet;
discrete = DISCRETE_EDEFAULT;
discreteESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, DroolsPackage.DISTRIBUTION_PARAMETER__DISCRETE, oldDiscrete, DISCRETE_EDEFAULT, oldDiscreteESet));
}
/**
*
*
* @generated
*/
public boolean isSetDiscrete() {
return discreteESet;
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DroolsPackage.DISTRIBUTION_PARAMETER__DISCRETE:
return isDiscrete();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DroolsPackage.DISTRIBUTION_PARAMETER__DISCRETE:
setDiscrete((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DroolsPackage.DISTRIBUTION_PARAMETER__DISCRETE:
unsetDiscrete();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DroolsPackage.DISTRIBUTION_PARAMETER__DISCRETE:
return isSetDiscrete();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (discrete: ");
if (discreteESet) result.append(discrete); else result.append("");
result.append(')');
return result.toString();
}
} //DistributionParameterImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy