/**
*/
package no.hal.jex.jextest.jexTest.impl;
import no.hal.jex.jextest.jexTest.JexTestPackage;
import no.hal.jex.jextest.jexTest.PropertiesTestOwner;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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.xtext.xbase.XBlockExpression;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Properties Test Owner</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link no.hal.jex.jextest.jexTest.impl.PropertiesTestOwnerImpl#getTest <em>Test</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PropertiesTestOwnerImpl extends MinimalEObjectImpl.Container implements PropertiesTestOwner
{
/**
* The cached value of the '{@link #getTest() <em>Test</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTest()
* @generated
* @ordered
*/
protected XBlockExpression test;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PropertiesTestOwnerImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return JexTestPackage.Literals.PROPERTIES_TEST_OWNER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public XBlockExpression getTest()
{
return test;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTest(XBlockExpression newTest, NotificationChain msgs)
{
XBlockExpression oldTest = test;
test = newTest;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JexTestPackage.PROPERTIES_TEST_OWNER__TEST, oldTest, newTest);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTest(XBlockExpression newTest)
{
if (newTest != test)
{
NotificationChain msgs = null;
if (test != null)
msgs = ((InternalEObject)test).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JexTestPackage.PROPERTIES_TEST_OWNER__TEST, null, msgs);
if (newTest != null)
msgs = ((InternalEObject)newTest).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JexTestPackage.PROPERTIES_TEST_OWNER__TEST, null, msgs);
msgs = basicSetTest(newTest, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JexTestPackage.PROPERTIES_TEST_OWNER__TEST, newTest, newTest));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case JexTestPackage.PROPERTIES_TEST_OWNER__TEST:
return basicSetTest(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case JexTestPackage.PROPERTIES_TEST_OWNER__TEST:
return getTest();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case JexTestPackage.PROPERTIES_TEST_OWNER__TEST:
setTest((XBlockExpression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case JexTestPackage.PROPERTIES_TEST_OWNER__TEST:
setTest((XBlockExpression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case JexTestPackage.PROPERTIES_TEST_OWNER__TEST:
return test != null;
}
return super.eIsSet(featureID);
}
} //PropertiesTestOwnerImpl