/*******************************************************************************
* Copyright (c) 2010-2015 Henshin developers. 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:
* TU Berlin, University of Luxembourg, SES S.A.
*******************************************************************************/
/**
*/
package lu.uni.snt.whileDSL.wHILE.impl;
import lu.uni.snt.whileDSL.wHILE.Fgmnt_LST_Elem;
import lu.uni.snt.whileDSL.wHILE.WHILEPackage;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Fgmnt LST Elem</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link lu.uni.snt.whileDSL.wHILE.impl.Fgmnt_LST_ElemImpl#getNext <em>Next</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class Fgmnt_LST_ElemImpl extends TargetImpl implements Fgmnt_LST_Elem
{
/**
* The cached value of the '{@link #getNext() <em>Next</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNext()
* @generated
* @ordered
*/
protected Fgmnt_LST_Elem next;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Fgmnt_LST_ElemImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return WHILEPackage.Literals.FGMNT_LST_ELEM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Fgmnt_LST_Elem getNext()
{
return next;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetNext(Fgmnt_LST_Elem newNext, NotificationChain msgs)
{
Fgmnt_LST_Elem oldNext = next;
next = newNext;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WHILEPackage.FGMNT_LST_ELEM__NEXT, oldNext, newNext);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setNext(Fgmnt_LST_Elem newNext)
{
if (newNext != next) {
NotificationChain msgs = null;
if (next != null)
msgs = ((InternalEObject)next).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - WHILEPackage.FGMNT_LST_ELEM__NEXT, null, msgs);
if (newNext != null)
msgs = ((InternalEObject)newNext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - WHILEPackage.FGMNT_LST_ELEM__NEXT, null, msgs);
msgs = basicSetNext(newNext, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WHILEPackage.FGMNT_LST_ELEM__NEXT, newNext, newNext));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID) {
case WHILEPackage.FGMNT_LST_ELEM__NEXT:
return basicSetNext(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 WHILEPackage.FGMNT_LST_ELEM__NEXT:
return getNext();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID) {
case WHILEPackage.FGMNT_LST_ELEM__NEXT:
setNext((Fgmnt_LST_Elem)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID) {
case WHILEPackage.FGMNT_LST_ELEM__NEXT:
setNext((Fgmnt_LST_Elem)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID) {
case WHILEPackage.FGMNT_LST_ELEM__NEXT:
return next != null;
}
return super.eIsSet(featureID);
}
} //Fgmnt_LST_ElemImpl