org.openxma.dsl.ddl.ddlDsl.impl.SqlNumberImpl Maven / Gradle / Ivy
The newest version!
/**
*
*
*
*/
package org.openxma.dsl.ddl.ddlDsl.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.openxma.dsl.ddl.ddlDsl.DdlDslPackage;
import org.openxma.dsl.ddl.ddlDsl.SqlNumber;
/**
*
* An implementation of the model object 'Sql Number'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.SqlNumberImpl#isHasPrecision Has Precision}
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.SqlNumberImpl#getPrecision Precision}
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.SqlNumberImpl#getScale Scale}
*
*
*
* @generated
*/
public class SqlNumberImpl extends SqlDataTypeImpl implements SqlNumber
{
/**
* The default value of the '{@link #isHasPrecision() Has Precision}' attribute.
*
*
* @see #isHasPrecision()
* @generated
* @ordered
*/
protected static final boolean HAS_PRECISION_EDEFAULT = false;
/**
* The cached value of the '{@link #isHasPrecision() Has Precision}' attribute.
*
*
* @see #isHasPrecision()
* @generated
* @ordered
*/
protected boolean hasPrecision = HAS_PRECISION_EDEFAULT;
/**
* The default value of the '{@link #getPrecision() Precision}' attribute.
*
*
* @see #getPrecision()
* @generated
* @ordered
*/
protected static final int PRECISION_EDEFAULT = 0;
/**
* The cached value of the '{@link #getPrecision() Precision}' attribute.
*
*
* @see #getPrecision()
* @generated
* @ordered
*/
protected int precision = PRECISION_EDEFAULT;
/**
* The default value of the '{@link #getScale() Scale}' attribute.
*
*
* @see #getScale()
* @generated
* @ordered
*/
protected static final int SCALE_EDEFAULT = 0;
/**
* The cached value of the '{@link #getScale() Scale}' attribute.
*
*
* @see #getScale()
* @generated
* @ordered
*/
protected int scale = SCALE_EDEFAULT;
/**
*
*
* @generated
*/
protected SqlNumberImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DdlDslPackage.Literals.SQL_NUMBER;
}
/**
*
*
* @generated
*/
public boolean isHasPrecision()
{
return hasPrecision;
}
/**
*
*
* @generated
*/
public void setHasPrecision(boolean newHasPrecision)
{
boolean oldHasPrecision = hasPrecision;
hasPrecision = newHasPrecision;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DdlDslPackage.SQL_NUMBER__HAS_PRECISION, oldHasPrecision, hasPrecision));
}
/**
*
*
* @generated
*/
public int getPrecision()
{
return precision;
}
/**
*
*
* @generated
*/
public void setPrecision(int newPrecision)
{
int oldPrecision = precision;
precision = newPrecision;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DdlDslPackage.SQL_NUMBER__PRECISION, oldPrecision, precision));
}
/**
*
*
* @generated
*/
public int getScale()
{
return scale;
}
/**
*
*
* @generated
*/
public void setScale(int newScale)
{
int oldScale = scale;
scale = newScale;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DdlDslPackage.SQL_NUMBER__SCALE, oldScale, scale));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID) {
case DdlDslPackage.SQL_NUMBER__HAS_PRECISION:
return isHasPrecision();
case DdlDslPackage.SQL_NUMBER__PRECISION:
return getPrecision();
case DdlDslPackage.SQL_NUMBER__SCALE:
return getScale();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID) {
case DdlDslPackage.SQL_NUMBER__HAS_PRECISION:
setHasPrecision((Boolean)newValue);
return;
case DdlDslPackage.SQL_NUMBER__PRECISION:
setPrecision((Integer)newValue);
return;
case DdlDslPackage.SQL_NUMBER__SCALE:
setScale((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID) {
case DdlDslPackage.SQL_NUMBER__HAS_PRECISION:
setHasPrecision(HAS_PRECISION_EDEFAULT);
return;
case DdlDslPackage.SQL_NUMBER__PRECISION:
setPrecision(PRECISION_EDEFAULT);
return;
case DdlDslPackage.SQL_NUMBER__SCALE:
setScale(SCALE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID) {
case DdlDslPackage.SQL_NUMBER__HAS_PRECISION:
return hasPrecision != HAS_PRECISION_EDEFAULT;
case DdlDslPackage.SQL_NUMBER__PRECISION:
return precision != PRECISION_EDEFAULT;
case DdlDslPackage.SQL_NUMBER__SCALE:
return scale != SCALE_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (hasPrecision: ");
result.append(hasPrecision);
result.append(", precision: ");
result.append(precision);
result.append(", scale: ");
result.append(scale);
result.append(')');
return result.toString();
}
} //SqlNumberImpl