/**
*/
package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.impl;
import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.CompositeElement;
import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Region;
import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.State;
import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.yakinduPackage;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'State'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.impl.StateImpl#getRegions Regions}
*
*
* @generated
*/
public class StateImpl extends RegularStateImpl implements State {
/**
* The cached value of the '{@link #getRegions() Regions}' containment reference list.
*
*
* @see #getRegions()
* @generated
* @ordered
*/
protected EList regions;
/**
*
*
* @generated
*/
protected StateImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return yakinduPackage.Literals.STATE;
}
/**
*
*
* @generated
*/
public EList getRegions() {
if (regions == null) {
regions = new EObjectContainmentEList(Region.class, this, yakinduPackage.STATE__REGIONS);
}
return regions;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case yakinduPackage.STATE__REGIONS:
return ((InternalEList>)getRegions()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case yakinduPackage.STATE__REGIONS:
return getRegions();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case yakinduPackage.STATE__REGIONS:
getRegions().clear();
getRegions().addAll((Collection extends Region>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case yakinduPackage.STATE__REGIONS:
getRegions().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case yakinduPackage.STATE__REGIONS:
return regions != null && !regions.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == CompositeElement.class) {
switch (derivedFeatureID) {
case yakinduPackage.STATE__REGIONS: return yakinduPackage.COMPOSITE_ELEMENT__REGIONS;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class> baseClass) {
if (baseClass == CompositeElement.class) {
switch (baseFeatureID) {
case yakinduPackage.COMPOSITE_ELEMENT__REGIONS: return yakinduPackage.STATE__REGIONS;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
} //StateImpl