org.openxma.dsl.ddl.ddlDsl.impl.SqlIntervalImpl Maven / Gradle / Ivy
/**
*
*
*
*/
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.SqlInterval;
/**
*
* An implementation of the model object 'Sql Interval'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.SqlIntervalImpl#isYear Year}
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.SqlIntervalImpl#isDay Day}
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.SqlIntervalImpl#getPrecision Precision}
* - {@link org.openxma.dsl.ddl.ddlDsl.impl.SqlIntervalImpl#getSecondsPrecision Seconds Precision}
*
*
*
* @generated
*/
public class SqlIntervalImpl extends SqlDateTimeImpl implements SqlInterval
{
/**
* The default value of the '{@link #isYear() Year}' attribute.
*
*
* @see #isYear()
* @generated
* @ordered
*/
protected static final boolean YEAR_EDEFAULT = false;
/**
* The cached value of the '{@link #isYear() Year}' attribute.
*
*
* @see #isYear()
* @generated
* @ordered
*/
protected boolean year = YEAR_EDEFAULT;
/**
* The default value of the '{@link #isDay() Day}' attribute.
*
*
* @see #isDay()
* @generated
* @ordered
*/
protected static final boolean DAY_EDEFAULT = false;
/**
* The cached value of the '{@link #isDay() Day}' attribute.
*
*
* @see #isDay()
* @generated
* @ordered
*/
protected boolean day = DAY_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 #getSecondsPrecision() Seconds Precision}' attribute.
*
*
* @see #getSecondsPrecision()
* @generated
* @ordered
*/
protected static final int SECONDS_PRECISION_EDEFAULT = 0;
/**
* The cached value of the '{@link #getSecondsPrecision() Seconds Precision}' attribute.
*
*
* @see #getSecondsPrecision()
* @generated
* @ordered
*/
protected int secondsPrecision = SECONDS_PRECISION_EDEFAULT;
/**
*
*
* @generated
*/
protected SqlIntervalImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DdlDslPackage.Literals.SQL_INTERVAL;
}
/**
*
*
* @generated
*/
public boolean isYear()
{
return year;
}
/**
*
*
* @generated
*/
public void setYear(boolean newYear)
{
boolean oldYear = year;
year = newYear;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DdlDslPackage.SQL_INTERVAL__YEAR, oldYear, year));
}
/**
*
*
* @generated
*/
public boolean isDay()
{
return day;
}
/**
*
*
* @generated
*/
public void setDay(boolean newDay)
{
boolean oldDay = day;
day = newDay;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DdlDslPackage.SQL_INTERVAL__DAY, oldDay, day));
}
/**
*
*
* @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_INTERVAL__PRECISION, oldPrecision, precision));
}
/**
*
*
* @generated
*/
public int getSecondsPrecision()
{
return secondsPrecision;
}
/**
*
*
* @generated
*/
public void setSecondsPrecision(int newSecondsPrecision)
{
int oldSecondsPrecision = secondsPrecision;
secondsPrecision = newSecondsPrecision;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DdlDslPackage.SQL_INTERVAL__SECONDS_PRECISION, oldSecondsPrecision, secondsPrecision));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID) {
case DdlDslPackage.SQL_INTERVAL__YEAR:
return isYear();
case DdlDslPackage.SQL_INTERVAL__DAY:
return isDay();
case DdlDslPackage.SQL_INTERVAL__PRECISION:
return getPrecision();
case DdlDslPackage.SQL_INTERVAL__SECONDS_PRECISION:
return getSecondsPrecision();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID) {
case DdlDslPackage.SQL_INTERVAL__YEAR:
setYear((Boolean)newValue);
return;
case DdlDslPackage.SQL_INTERVAL__DAY:
setDay((Boolean)newValue);
return;
case DdlDslPackage.SQL_INTERVAL__PRECISION:
setPrecision((Integer)newValue);
return;
case DdlDslPackage.SQL_INTERVAL__SECONDS_PRECISION:
setSecondsPrecision((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID) {
case DdlDslPackage.SQL_INTERVAL__YEAR:
setYear(YEAR_EDEFAULT);
return;
case DdlDslPackage.SQL_INTERVAL__DAY:
setDay(DAY_EDEFAULT);
return;
case DdlDslPackage.SQL_INTERVAL__PRECISION:
setPrecision(PRECISION_EDEFAULT);
return;
case DdlDslPackage.SQL_INTERVAL__SECONDS_PRECISION:
setSecondsPrecision(SECONDS_PRECISION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID) {
case DdlDslPackage.SQL_INTERVAL__YEAR:
return year != YEAR_EDEFAULT;
case DdlDslPackage.SQL_INTERVAL__DAY:
return day != DAY_EDEFAULT;
case DdlDslPackage.SQL_INTERVAL__PRECISION:
return precision != PRECISION_EDEFAULT;
case DdlDslPackage.SQL_INTERVAL__SECONDS_PRECISION:
return secondsPrecision != SECONDS_PRECISION_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (year: ");
result.append(year);
result.append(", day: ");
result.append(day);
result.append(", precision: ");
result.append(precision);
result.append(", secondsPrecision: ");
result.append(secondsPrecision);
result.append(')');
return result.toString();
}
} //SqlIntervalImpl