/*******************************************************************************
* Copyright (c) 2008, 2011 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.eef.modelingBot.EEFActions.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.eef.modelingBot.EEFActions.Add;
import org.eclipse.emf.eef.modelingBot.EEFActions.EEFActionsPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Add</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.eef.modelingBot.EEFActions.impl.AddImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.emf.eef.modelingBot.EEFActions.impl.AddImpl#getEContainingFeature <em>EContaining Feature</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AddImpl extends EditActionImpl implements Add {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected EClass type;
/**
* The cached value of the '{@link #getEContainingFeature() <em>EContaining Feature</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEContainingFeature()
* @generated
* @ordered
*/
protected EStructuralFeature eContainingFeature;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AddImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EEFActionsPackage.Literals.ADD;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (EClass)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EEFActionsPackage.ADD__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass basicGetType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(EClass newType) {
EClass oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EEFActionsPackage.ADD__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature getEContainingFeature() {
if (eContainingFeature != null && eContainingFeature.eIsProxy()) {
InternalEObject oldEContainingFeature = (InternalEObject)eContainingFeature;
eContainingFeature = (EStructuralFeature)eResolveProxy(oldEContainingFeature);
if (eContainingFeature != oldEContainingFeature) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EEFActionsPackage.ADD__ECONTAINING_FEATURE, oldEContainingFeature, eContainingFeature));
}
}
return eContainingFeature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature basicGetEContainingFeature() {
return eContainingFeature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEContainingFeature(EStructuralFeature newEContainingFeature) {
EStructuralFeature oldEContainingFeature = eContainingFeature;
eContainingFeature = newEContainingFeature;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EEFActionsPackage.ADD__ECONTAINING_FEATURE, oldEContainingFeature, eContainingFeature));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EEFActionsPackage.ADD__TYPE:
if (resolve) return getType();
return basicGetType();
case EEFActionsPackage.ADD__ECONTAINING_FEATURE:
if (resolve) return getEContainingFeature();
return basicGetEContainingFeature();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EEFActionsPackage.ADD__TYPE:
setType((EClass)newValue);
return;
case EEFActionsPackage.ADD__ECONTAINING_FEATURE:
setEContainingFeature((EStructuralFeature)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EEFActionsPackage.ADD__TYPE:
setType((EClass)null);
return;
case EEFActionsPackage.ADD__ECONTAINING_FEATURE:
setEContainingFeature((EStructuralFeature)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EEFActionsPackage.ADD__TYPE:
return type != null;
case EEFActionsPackage.ADD__ECONTAINING_FEATURE:
return eContainingFeature != null;
}
return super.eIsSet(featureID);
}
} //AddImpl