blob: 17820f62a9dc64d8b34805a848c24dc3198fa2af [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.impl;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.TypeDefinition;
import org.eclipse.app4mc.amalthea.model.TypeRef;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Type Ref</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.TypeRefImpl#getTypeDef <em>Type Def</em>}</li>
* </ul>
*
* @generated
*/
public class TypeRefImpl extends BaseObjectImpl implements TypeRef {
/**
* The cached value of the '{@link #getTypeDef() <em>Type Def</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTypeDef()
* @generated
* @ordered
*/
protected TypeDefinition typeDef;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TypeRefImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getTypeRef();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public TypeDefinition getTypeDef() {
if (typeDef != null && typeDef.eIsProxy()) {
InternalEObject oldTypeDef = (InternalEObject)typeDef;
typeDef = (TypeDefinition)eResolveProxy(oldTypeDef);
if (typeDef != oldTypeDef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.TYPE_REF__TYPE_DEF, oldTypeDef, typeDef));
}
}
return typeDef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TypeDefinition basicGetTypeDef() {
return typeDef;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setTypeDef(TypeDefinition newTypeDef) {
TypeDefinition oldTypeDef = typeDef;
typeDef = newTypeDef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.TYPE_REF__TYPE_DEF, oldTypeDef, typeDef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.TYPE_REF__TYPE_DEF:
if (resolve) return getTypeDef();
return basicGetTypeDef();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.TYPE_REF__TYPE_DEF:
setTypeDef((TypeDefinition)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.TYPE_REF__TYPE_DEF:
setTypeDef((TypeDefinition)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.TYPE_REF__TYPE_DEF:
return typeDef != null;
}
return super.eIsSet(featureID);
}
} //TypeRefImpl