/**
* This file is protected by Copyright.
* Please refer to the COPYRIGHT file distributed with this source distribution.
*
* This file is part of REDHAWK IDE.
*
* 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.
*
*/
// BEGIN GENERATED CODE
package gov.redhawk.eclipsecorba.idl.types.impl;
import gov.redhawk.eclipsecorba.idl.impl.IdlTypeDclImpl;
import gov.redhawk.eclipsecorba.idl.types.StructForwardDcl;
import gov.redhawk.eclipsecorba.idl.types.StructType;
import gov.redhawk.eclipsecorba.idl.types.TypesPackage;
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>Struct Forward Dcl</b></em>'.
* @since 6.0
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link gov.redhawk.eclipsecorba.idl.types.impl.StructForwardDclImpl#getImplementation <em>Implementation</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StructForwardDclImpl extends IdlTypeDclImpl implements StructForwardDcl {
/**
* The cached value of the '{@link #getImplementation() <em>Implementation</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getImplementation()
* @generated
* @ordered
*/
protected StructType implementation;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StructForwardDclImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TypesPackage.Literals.STRUCT_FORWARD_DCL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StructType getImplementation() {
if (implementation != null && implementation.eIsProxy()) {
InternalEObject oldImplementation = (InternalEObject)implementation;
implementation = (StructType)eResolveProxy(oldImplementation);
if (implementation != oldImplementation) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION, oldImplementation, implementation));
}
}
return implementation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StructType basicGetImplementation() {
return implementation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetImplementation(StructType newImplementation, NotificationChain msgs) {
StructType oldImplementation = implementation;
implementation = newImplementation;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION, oldImplementation, newImplementation);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setImplementation(StructType newImplementation) {
if (newImplementation != implementation) {
NotificationChain msgs = null;
if (implementation != null)
msgs = ((InternalEObject)implementation).eInverseRemove(this, TypesPackage.STRUCT_TYPE__FORWARD_DCL, StructType.class, msgs);
if (newImplementation != null)
msgs = ((InternalEObject)newImplementation).eInverseAdd(this, TypesPackage.STRUCT_TYPE__FORWARD_DCL, StructType.class, msgs);
msgs = basicSetImplementation(newImplementation, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION, newImplementation, newImplementation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION:
if (implementation != null)
msgs = ((InternalEObject)implementation).eInverseRemove(this, TypesPackage.STRUCT_TYPE__FORWARD_DCL, StructType.class, msgs);
return basicSetImplementation((StructType)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION:
return basicSetImplementation(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 TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION:
if (resolve) return getImplementation();
return basicGetImplementation();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION:
setImplementation((StructType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION:
setImplementation((StructType)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TypesPackage.STRUCT_FORWARD_DCL__IMPLEMENTATION:
return implementation != null;
}
return super.eIsSet(featureID);
}
@Override
public String getId() {
if (this.id == null) {
// TODO Auto-generated method stub
return super.getId()+"Forward";
}
return super.getId();
}
/**
* {@inheritDoc}
*/
@Override
public String getScopedName() {
// TODO Auto-generated method stub
return super.getScopedName() + "Forward";
}
} //StructForwardDclImpl