/**
* <copyright>
* </copyright>
*
* $Id$
*/
package orgomg.cwm.management.warehouseprocess.events.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import orgomg.cwm.management.warehouseprocess.events.EventsPackage;
import orgomg.cwm.management.warehouseprocess.events.IntervalEvent;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Interval Event</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link orgomg.cwm.management.warehouseprocess.events.impl.IntervalEventImpl#getDuration <em>Duration</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class IntervalEventImpl extends ScheduleEventImpl implements IntervalEvent {
/**
* The default value of the '{@link #getDuration() <em>Duration</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDuration()
* @generated
* @ordered
*/
protected static final String DURATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDuration() <em>Duration</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDuration()
* @generated
* @ordered
*/
protected String duration = DURATION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IntervalEventImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EventsPackage.Literals.INTERVAL_EVENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDuration() {
return duration;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDuration(String newDuration) {
String oldDuration = duration;
duration = newDuration;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EventsPackage.INTERVAL_EVENT__DURATION, oldDuration, duration));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EventsPackage.INTERVAL_EVENT__DURATION:
return getDuration();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EventsPackage.INTERVAL_EVENT__DURATION:
setDuration((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EventsPackage.INTERVAL_EVENT__DURATION:
setDuration(DURATION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EventsPackage.INTERVAL_EVENT__DURATION:
return DURATION_EDEFAULT == null ? duration != null : !DURATION_EDEFAULT.equals(duration);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (duration: ");
result.append(duration);
result.append(')');
return result.toString();
}
} //IntervalEventImpl