/*******************************************************************************
* 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.EEFActionsPackage;
import org.eclipse.emf.eef.modelingBot.EEFActions.Unset;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Unset</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.eef.modelingBot.EEFActions.impl.UnsetImpl#getFeature <em>Feature</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class UnsetImpl extends EditActionImpl implements Unset {
/**
* The cached value of the '{@link #getFeature() <em>Feature</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFeature()
* @generated
* @ordered
*/
protected EStructuralFeature feature;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected UnsetImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EEFActionsPackage.Literals.UNSET;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature getFeature() {
if (feature != null && feature.eIsProxy()) {
InternalEObject oldFeature = (InternalEObject)feature;
feature = (EStructuralFeature)eResolveProxy(oldFeature);
if (feature != oldFeature) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EEFActionsPackage.UNSET__FEATURE, oldFeature, feature));
}
}
return feature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature basicGetFeature() {
return feature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFeature(EStructuralFeature newFeature) {
EStructuralFeature oldFeature = feature;
feature = newFeature;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EEFActionsPackage.UNSET__FEATURE, oldFeature, feature));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EEFActionsPackage.UNSET__FEATURE:
if (resolve) return getFeature();
return basicGetFeature();
}
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.UNSET__FEATURE:
setFeature((EStructuralFeature)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EEFActionsPackage.UNSET__FEATURE:
setFeature((EStructuralFeature)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EEFActionsPackage.UNSET__FEATURE:
return feature != null;
}
return super.eIsSet(featureID);
}
} //UnsetImpl