/**
* <copyright>
* </copyright>
*
* $Id$
*/
package no.playtrd.v10.playtrd.impl;
import no.playtrd.v10.playtrd.ObjectLocation;
import no.playtrd.v10.playtrd.PlaytrdPackage;
import no.playtrd.v10.playtrd.Positioned;
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.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Object Location</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link no.playtrd.v10.playtrd.impl.ObjectLocationImpl#getPositioned <em>Positioned</em>}</li>
* <li>{@link no.playtrd.v10.playtrd.impl.ObjectLocationImpl#getTarget <em>Target</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ObjectLocationImpl extends EObjectImpl implements ObjectLocation {
/**
* The cached value of the '{@link #getPositioned() <em>Positioned</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPositioned()
* @generated
* @ordered
*/
protected Positioned positioned;
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected Positioned target;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ObjectLocationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return PlaytrdPackage.Literals.OBJECT_LOCATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Positioned getPositioned() {
if (positioned != null && positioned.eIsProxy()) {
InternalEObject oldPositioned = (InternalEObject)positioned;
positioned = (Positioned)eResolveProxy(oldPositioned);
if (positioned != oldPositioned) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PlaytrdPackage.OBJECT_LOCATION__POSITIONED, oldPositioned, positioned));
}
}
return positioned;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Positioned basicGetPositioned() {
return positioned;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPositioned(Positioned newPositioned) {
Positioned oldPositioned = positioned;
positioned = newPositioned;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PlaytrdPackage.OBJECT_LOCATION__POSITIONED, oldPositioned, positioned));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Positioned getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (Positioned)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PlaytrdPackage.OBJECT_LOCATION__TARGET, oldTarget, target));
}
}
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Positioned basicGetTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTarget(Positioned newTarget) {
Positioned oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PlaytrdPackage.OBJECT_LOCATION__TARGET, oldTarget, target));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PlaytrdPackage.OBJECT_LOCATION__POSITIONED:
if (resolve) return getPositioned();
return basicGetPositioned();
case PlaytrdPackage.OBJECT_LOCATION__TARGET:
if (resolve) return getTarget();
return basicGetTarget();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case PlaytrdPackage.OBJECT_LOCATION__POSITIONED:
setPositioned((Positioned)newValue);
return;
case PlaytrdPackage.OBJECT_LOCATION__TARGET:
setTarget((Positioned)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PlaytrdPackage.OBJECT_LOCATION__POSITIONED:
setPositioned((Positioned)null);
return;
case PlaytrdPackage.OBJECT_LOCATION__TARGET:
setTarget((Positioned)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PlaytrdPackage.OBJECT_LOCATION__POSITIONED:
return positioned != null;
case PlaytrdPackage.OBJECT_LOCATION__TARGET:
return target != null;
}
return super.eIsSet(featureID);
}
} //ObjectLocationImpl