/**
* Copyright (c) 2013 Eclipse contributors and others.
* 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
*/
package org.eclipse.emf.test.common.reification.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.eclipse.emf.test.common.reification.BoundedGenericContainer;
import org.eclipse.emf.test.common.reification.Medium;
import org.eclipse.emf.test.common.reification.ReificationPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Bounded Generic Container</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.emf.test.common.reification.impl.BoundedGenericContainerImpl#getContent <em>Content</em>}</li>
* </ul>
*
* @generated
*/
public class BoundedGenericContainerImpl<T extends Medium> extends EObjectImpl implements BoundedGenericContainer<T>
{
/**
* The cached value of the '{@link #getContent() <em>Content</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContent()
* @generated
* @ordered
*/
protected T content;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected BoundedGenericContainerImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ReificationPackage.Literals.BOUNDED_GENERIC_CONTAINER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
public T getContent()
{
if (content != null && content.eIsProxy())
{
InternalEObject oldContent = (InternalEObject)content;
content = (T)eResolveProxy(oldContent);
if (content != oldContent)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReificationPackage.BOUNDED_GENERIC_CONTAINER__CONTENT, oldContent, content));
}
}
return content;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public T basicGetContent()
{
return content;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setContent(T newContent)
{
T oldContent = content;
content = newContent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReificationPackage.BOUNDED_GENERIC_CONTAINER__CONTENT, oldContent, content));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ReificationPackage.BOUNDED_GENERIC_CONTAINER__CONTENT:
if (resolve) return getContent();
return basicGetContent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ReificationPackage.BOUNDED_GENERIC_CONTAINER__CONTENT:
setContent((T)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ReificationPackage.BOUNDED_GENERIC_CONTAINER__CONTENT:
setContent((T)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ReificationPackage.BOUNDED_GENERIC_CONTAINER__CONTENT:
return content != null;
}
return super.eIsSet(featureID);
}
} //BoundedGenericContainerImpl