/**
*/
package org.eclipse.xtext.xdoc.xdoc.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.xtext.xdoc.xdoc.Chapter;
import org.eclipse.xtext.xdoc.xdoc.ChapterRef;
import org.eclipse.xtext.xdoc.xdoc.XdocPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Chapter Ref</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.xtext.xdoc.xdoc.impl.ChapterRefImpl#getChapter <em>Chapter</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ChapterRefImpl extends ChapterImpl implements ChapterRef
{
/**
* The cached value of the '{@link #getChapter() <em>Chapter</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChapter()
* @generated
* @ordered
*/
protected Chapter chapter;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ChapterRefImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return XdocPackage.Literals.CHAPTER_REF;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Chapter getChapter()
{
if (chapter != null && chapter.eIsProxy())
{
InternalEObject oldChapter = (InternalEObject)chapter;
chapter = (Chapter)eResolveProxy(oldChapter);
if (chapter != oldChapter)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, XdocPackage.CHAPTER_REF__CHAPTER, oldChapter, chapter));
}
}
return chapter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Chapter basicGetChapter()
{
return chapter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setChapter(Chapter newChapter)
{
Chapter oldChapter = chapter;
chapter = newChapter;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XdocPackage.CHAPTER_REF__CHAPTER, oldChapter, chapter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XdocPackage.CHAPTER_REF__CHAPTER:
if (resolve) return getChapter();
return basicGetChapter();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case XdocPackage.CHAPTER_REF__CHAPTER:
setChapter((Chapter)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case XdocPackage.CHAPTER_REF__CHAPTER:
setChapter((Chapter)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XdocPackage.CHAPTER_REF__CHAPTER:
return chapter != null;
}
return super.eIsSet(featureID);
}
} //ChapterRefImpl