/*******************************************************************************
* Copyright (c) 2010 Michal Antkiewicz.
* 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:
* Michal Antkiewicz - initial API and implementation
******************************************************************************/
package ca.uwaterloo.gsd.fsml.sync.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import ca.uwaterloo.gsd.fsml.sync.ClassSyncItem;
import ca.uwaterloo.gsd.fsml.sync.StructuralFeatureSyncItem;
import ca.uwaterloo.gsd.fsml.sync.SyncPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Structural Feature Sync Item</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link ca.uwaterloo.gsd.fsml.sync.impl.StructuralFeatureSyncItemImpl#getStructuralFeature <em>Structural Feature</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StructuralFeatureSyncItemImpl extends SyncItemImpl implements StructuralFeatureSyncItem {
/**
* The cached value of the '{@link #getStructuralFeature() <em>Structural Feature</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStructuralFeature()
* @generated
* @ordered
*/
protected EStructuralFeature structuralFeature;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StructuralFeatureSyncItemImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SyncPackage.Literals.STRUCTURAL_FEATURE_SYNC_ITEM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature getStructuralFeature() {
if (structuralFeature != null && structuralFeature.eIsProxy()) {
InternalEObject oldStructuralFeature = (InternalEObject)structuralFeature;
structuralFeature = (EStructuralFeature)eResolveProxy(oldStructuralFeature);
if (structuralFeature != oldStructuralFeature) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SyncPackage.STRUCTURAL_FEATURE_SYNC_ITEM__STRUCTURAL_FEATURE, oldStructuralFeature, structuralFeature));
}
}
return structuralFeature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature basicGetStructuralFeature() {
return structuralFeature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStructuralFeature(EStructuralFeature newStructuralFeature) {
EStructuralFeature oldStructuralFeature = structuralFeature;
structuralFeature = newStructuralFeature;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SyncPackage.STRUCTURAL_FEATURE_SYNC_ITEM__STRUCTURAL_FEATURE, oldStructuralFeature, structuralFeature));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SyncPackage.STRUCTURAL_FEATURE_SYNC_ITEM__STRUCTURAL_FEATURE:
if (resolve) return getStructuralFeature();
return basicGetStructuralFeature();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SyncPackage.STRUCTURAL_FEATURE_SYNC_ITEM__STRUCTURAL_FEATURE:
setStructuralFeature((EStructuralFeature)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SyncPackage.STRUCTURAL_FEATURE_SYNC_ITEM__STRUCTURAL_FEATURE:
setStructuralFeature((EStructuralFeature)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SyncPackage.STRUCTURAL_FEATURE_SYNC_ITEM__STRUCTURAL_FEATURE:
return structuralFeature != null;
}
return super.eIsSet(featureID);
}
@Override
public EObject getModel() {
return ((ClassSyncItem) eContainer).getModel();
}
@Override
public EObject getCode() {
return ((ClassSyncItem) eContainer).getCode();
}
} //StructuralFeatureSyncItemImpl