/*******************************************************************************
* Copyright (c) 2012 jnect.org.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* ${user} - initial API and implementation
*******************************************************************************/
package org.jnect.bodymodel.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.EObjectImpl;
import org.jnect.bodymodel.BodymodelPackage;
import org.jnect.bodymodel.HumanLink;
import org.jnect.bodymodel.PositionedElement;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Human Link</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.jnect.bodymodel.impl.HumanLinkImpl#getSource <em>Source</em>}</li>
* <li>{@link org.jnect.bodymodel.impl.HumanLinkImpl#getTarget <em>Target</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class HumanLinkImpl extends EObjectImpl implements HumanLink {
/**
* The cached value of the '{@link #getSource() <em>Source</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSource()
* @generated
* @ordered
*/
protected PositionedElement source;
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected PositionedElement target;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected HumanLinkImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BodymodelPackage.Literals.HUMAN_LINK;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PositionedElement getSource() {
if (source != null && source.eIsProxy()) {
InternalEObject oldSource = (InternalEObject)source;
source = (PositionedElement)eResolveProxy(oldSource);
if (source != oldSource) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BodymodelPackage.HUMAN_LINK__SOURCE, oldSource, source));
}
}
return source;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PositionedElement basicGetSource() {
return source;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSource(PositionedElement newSource) {
PositionedElement oldSource = source;
source = newSource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BodymodelPackage.HUMAN_LINK__SOURCE, oldSource, source));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PositionedElement getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (PositionedElement)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BodymodelPackage.HUMAN_LINK__TARGET, oldTarget, target));
}
}
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PositionedElement basicGetTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTarget(PositionedElement newTarget) {
PositionedElement oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BodymodelPackage.HUMAN_LINK__TARGET, oldTarget, target));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BodymodelPackage.HUMAN_LINK__SOURCE:
if (resolve) return getSource();
return basicGetSource();
case BodymodelPackage.HUMAN_LINK__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 BodymodelPackage.HUMAN_LINK__SOURCE:
setSource((PositionedElement)newValue);
return;
case BodymodelPackage.HUMAN_LINK__TARGET:
setTarget((PositionedElement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BodymodelPackage.HUMAN_LINK__SOURCE:
setSource((PositionedElement)null);
return;
case BodymodelPackage.HUMAN_LINK__TARGET:
setTarget((PositionedElement)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BodymodelPackage.HUMAN_LINK__SOURCE:
return source != null;
case BodymodelPackage.HUMAN_LINK__TARGET:
return target != null;
}
return super.eIsSet(featureID);
}
} //HumanLinkImpl