/*******************************************************************************
* 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.repeat.rEPEAT.impl;
import lu.uni.snt.repeat.rEPEAT.REPEATPackage;
import lu.uni.snt.repeat.rEPEAT.Stmnt_LST_Elem;
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>Stmnt LST Elem</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link lu.uni.snt.repeat.rEPEAT.impl.Stmnt_LST_ElemImpl#getNext <em>Next</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class Stmnt_LST_ElemImpl extends SourceImpl implements Stmnt_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 Stmnt_LST_Elem next;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Stmnt_LST_ElemImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return REPEATPackage.Literals.STMNT_LST_ELEM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Stmnt_LST_Elem getNext()
{
return next;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetNext(Stmnt_LST_Elem newNext, NotificationChain msgs)
{
Stmnt_LST_Elem oldNext = next;
next = newNext;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, REPEATPackage.STMNT_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(Stmnt_LST_Elem newNext)
{
if (newNext != next) {
NotificationChain msgs = null;
if (next != null)
msgs = ((InternalEObject)next).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - REPEATPackage.STMNT_LST_ELEM__NEXT, null, msgs);
if (newNext != null)
msgs = ((InternalEObject)newNext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - REPEATPackage.STMNT_LST_ELEM__NEXT, null, msgs);
msgs = basicSetNext(newNext, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, REPEATPackage.STMNT_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 REPEATPackage.STMNT_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 REPEATPackage.STMNT_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 REPEATPackage.STMNT_LST_ELEM__NEXT:
setNext((Stmnt_LST_Elem)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID) {
case REPEATPackage.STMNT_LST_ELEM__NEXT:
setNext((Stmnt_LST_Elem)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID) {
case REPEATPackage.STMNT_LST_ELEM__NEXT:
return next != null;
}
return super.eIsSet(featureID);
}
} //Stmnt_LST_ElemImpl