blob: ba6cc42cf330bbb5861c17e76e5a68e5897894e0 [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
* $Id: CompoundStateImpl.java,v 1.1 2011/03/15 07:51:54 ewillink Exp $
*/
package org.eclipse.ocl.tutorial.eclipsecon2011.oclstates.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.ocl.tutorial.eclipsecon2011.oclstates.CompoundState;
import org.eclipse.ocl.tutorial.eclipsecon2011.oclstates.OCLStatesPackage;
import org.eclipse.ocl.tutorial.eclipsecon2011.oclstates.Statemachine;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Compound State</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.ocl.tutorial.eclipsecon2011.oclstates.impl.CompoundStateImpl#getMachine <em>Machine</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CompoundStateImpl extends StateImpl implements CompoundState {
/**
* The cached value of the '{@link #getMachine() <em>Machine</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMachine()
* @generated
* @ordered
*/
protected Statemachine machine;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CompoundStateImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return OCLStatesPackage.Literals.COMPOUND_STATE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Statemachine getMachine() {
if (machine != null && machine.eIsProxy()) {
InternalEObject oldMachine = (InternalEObject)machine;
machine = (Statemachine)eResolveProxy(oldMachine);
if (machine != oldMachine) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, OCLStatesPackage.COMPOUND_STATE__MACHINE, oldMachine, machine));
}
}
return machine;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Statemachine basicGetMachine() {
return machine;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMachine(Statemachine newMachine) {
Statemachine oldMachine = machine;
machine = newMachine;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OCLStatesPackage.COMPOUND_STATE__MACHINE, oldMachine, machine));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case OCLStatesPackage.COMPOUND_STATE__MACHINE:
if (resolve) return getMachine();
return basicGetMachine();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case OCLStatesPackage.COMPOUND_STATE__MACHINE:
setMachine((Statemachine)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case OCLStatesPackage.COMPOUND_STATE__MACHINE:
setMachine((Statemachine)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case OCLStatesPackage.COMPOUND_STATE__MACHINE:
return machine != null;
}
return super.eIsSet(featureID);
}
} //CompoundStateImpl