/**
* <copyright>
* </copyright>
*
*/
package org.eclipse.etrice.core.room.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.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.etrice.core.room.ActorContainerRef;
import org.eclipse.etrice.core.room.RoomPackage;
import org.eclipse.etrice.core.room.SPPRef;
import org.eclipse.etrice.core.room.SPPoint;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>SP Point</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.etrice.core.room.impl.SPPointImpl#getRef <em>Ref</em>}</li>
* <li>{@link org.eclipse.etrice.core.room.impl.SPPointImpl#getService <em>Service</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class SPPointImpl extends MinimalEObjectImpl.Container implements SPPoint
{
/**
* The cached value of the '{@link #getRef() <em>Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRef()
* @generated
* @ordered
*/
protected ActorContainerRef ref;
/**
* The cached value of the '{@link #getService() <em>Service</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getService()
* @generated
* @ordered
*/
protected SPPRef service;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SPPointImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return RoomPackage.Literals.SP_POINT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ActorContainerRef getRef()
{
if (ref != null && ref.eIsProxy())
{
InternalEObject oldRef = (InternalEObject)ref;
ref = (ActorContainerRef)eResolveProxy(oldRef);
if (ref != oldRef)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, RoomPackage.SP_POINT__REF, oldRef, ref));
}
}
return ref;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ActorContainerRef basicGetRef()
{
return ref;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef(ActorContainerRef newRef)
{
ActorContainerRef oldRef = ref;
ref = newRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RoomPackage.SP_POINT__REF, oldRef, ref));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SPPRef getService()
{
if (service != null && service.eIsProxy())
{
InternalEObject oldService = (InternalEObject)service;
service = (SPPRef)eResolveProxy(oldService);
if (service != oldService)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, RoomPackage.SP_POINT__SERVICE, oldService, service));
}
}
return service;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SPPRef basicGetService()
{
return service;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setService(SPPRef newService)
{
SPPRef oldService = service;
service = newService;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RoomPackage.SP_POINT__SERVICE, oldService, service));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case RoomPackage.SP_POINT__REF:
if (resolve) return getRef();
return basicGetRef();
case RoomPackage.SP_POINT__SERVICE:
if (resolve) return getService();
return basicGetService();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case RoomPackage.SP_POINT__REF:
setRef((ActorContainerRef)newValue);
return;
case RoomPackage.SP_POINT__SERVICE:
setService((SPPRef)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case RoomPackage.SP_POINT__REF:
setRef((ActorContainerRef)null);
return;
case RoomPackage.SP_POINT__SERVICE:
setService((SPPRef)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case RoomPackage.SP_POINT__REF:
return ref != null;
case RoomPackage.SP_POINT__SERVICE:
return service != null;
}
return super.eIsSet(featureID);
}
} //SPPointImpl