/***************************************************************************** | |
* Copyright (c) 2011 - 2014 University of Padova, Intecs | |
* | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v20.html | |
* | |
* | |
*****************************************************************************/ | |
package org.polarsys.chess.chessmlprofile.Dependability.StateBased.FaultTolerance.impl; | |
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; | |
import org.eclipse.emf.ecore.impl.EObjectImpl; | |
import org.eclipse.uml2.uml.Component; | |
import org.polarsys.chess.chessmlprofile.Dependability.StateBased.FaultTolerance.FaultTolerancePackage; | |
import org.polarsys.chess.chessmlprofile.Dependability.StateBased.FaultTolerance.Variant; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Variant</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.polarsys.chess.chessmlprofile.Dependability.StateBased.FaultTolerance.impl.VariantImpl#getBase_Component <em>Base Component</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class VariantImpl extends EObjectImpl implements Variant { | |
/** | |
* The cached value of the '{@link #getBase_Component() <em>Base Component</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getBase_Component() | |
* @generated | |
* @ordered | |
*/ | |
protected Component base_Component; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected VariantImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return FaultTolerancePackage.Literals.VARIANT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Component getBase_Component() { | |
if (base_Component != null && base_Component.eIsProxy()) { | |
InternalEObject oldBase_Component = (InternalEObject)base_Component; | |
base_Component = (Component)eResolveProxy(oldBase_Component); | |
if (base_Component != oldBase_Component) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FaultTolerancePackage.VARIANT__BASE_COMPONENT, oldBase_Component, base_Component)); | |
} | |
} | |
return base_Component; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Component basicGetBase_Component() { | |
return base_Component; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setBase_Component(Component newBase_Component) { | |
Component oldBase_Component = base_Component; | |
base_Component = newBase_Component; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, FaultTolerancePackage.VARIANT__BASE_COMPONENT, oldBase_Component, base_Component)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case FaultTolerancePackage.VARIANT__BASE_COMPONENT: | |
if (resolve) return getBase_Component(); | |
return basicGetBase_Component(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case FaultTolerancePackage.VARIANT__BASE_COMPONENT: | |
setBase_Component((Component)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case FaultTolerancePackage.VARIANT__BASE_COMPONENT: | |
setBase_Component((Component)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case FaultTolerancePackage.VARIANT__BASE_COMPONENT: | |
return base_Component != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //VariantImpl |