/**
*/
package org.eclipse.papyrus.eastadl.annex.temporalconstraint.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.papyrus.eastadl.annex.temporalconstraint.State;
import org.eclipse.papyrus.eastadl.annex.temporalconstraint.StateEvent;
import org.eclipse.papyrus.eastadl.annex.temporalconstraint.TemporalconstraintPackage;
import org.eclipse.papyrus.eastadl.timing.impl.EventImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>State Event</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.eastadl.annex.temporalconstraint.impl.StateEventImpl#getEnd <em>End</em>}</li>
* <li>{@link org.eclipse.papyrus.eastadl.annex.temporalconstraint.impl.StateEventImpl#getStart <em>Start</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StateEventImpl extends EventImpl implements StateEvent {
/**
* The cached value of the '{@link #getEnd() <em>End</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getEnd()
* @generated
* @ordered
*/
protected State end;
/**
* The cached value of the '{@link #getStart() <em>Start</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getStart()
* @generated
* @ordered
*/
protected State start;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected StateEventImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return TemporalconstraintPackage.Literals.STATE_EVENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public State getEnd() {
if (end != null && end.eIsProxy()) {
InternalEObject oldEnd = (InternalEObject) end;
end = (State) eResolveProxy(oldEnd);
if (end != oldEnd) {
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TemporalconstraintPackage.STATE_EVENT__END, oldEnd, end));
}
}
}
return end;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public State basicGetEnd() {
return end;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setEnd(State newEnd) {
State oldEnd = end;
end = newEnd;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, TemporalconstraintPackage.STATE_EVENT__END, oldEnd, end));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public State getStart() {
if (start != null && start.eIsProxy()) {
InternalEObject oldStart = (InternalEObject) start;
start = (State) eResolveProxy(oldStart);
if (start != oldStart) {
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TemporalconstraintPackage.STATE_EVENT__START, oldStart, start));
}
}
}
return start;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public State basicGetStart() {
return start;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setStart(State newStart) {
State oldStart = start;
start = newStart;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, TemporalconstraintPackage.STATE_EVENT__START, oldStart, start));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TemporalconstraintPackage.STATE_EVENT__END:
if (resolve) {
return getEnd();
}
return basicGetEnd();
case TemporalconstraintPackage.STATE_EVENT__START:
if (resolve) {
return getStart();
}
return basicGetStart();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TemporalconstraintPackage.STATE_EVENT__END:
setEnd((State) newValue);
return;
case TemporalconstraintPackage.STATE_EVENT__START:
setStart((State) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TemporalconstraintPackage.STATE_EVENT__END:
setEnd((State) null);
return;
case TemporalconstraintPackage.STATE_EVENT__START:
setStart((State) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TemporalconstraintPackage.STATE_EVENT__END:
return end != null;
case TemporalconstraintPackage.STATE_EVENT__START:
return start != null;
}
return super.eIsSet(featureID);
}
} // StateEventImpl