/**
*/
package org.eclipse.viatra.solver.language.model.problem.impl;
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.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.viatra.solver.language.model.problem.ProblemPackage;
import org.eclipse.viatra.solver.language.model.problem.ScopeDeclaration;
import org.eclipse.viatra.solver.language.model.problem.TypeScope;
/**
*
* An implementation of the model object 'Scope Declaration'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.viatra.solver.language.model.problem.impl.ScopeDeclarationImpl#getTypeScopes Type Scopes}
*
*
* @generated
*/
public class ScopeDeclarationImpl extends MinimalEObjectImpl.Container implements ScopeDeclaration {
/**
* The cached value of the '{@link #getTypeScopes() Type Scopes}' containment reference list.
*
*
* @see #getTypeScopes()
* @generated
* @ordered
*/
protected EList typeScopes;
/**
*
*
* @generated
*/
protected ScopeDeclarationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ProblemPackage.Literals.SCOPE_DECLARATION;
}
/**
*
*
* @generated
*/
public EList getTypeScopes() {
if (typeScopes == null) {
typeScopes = new EObjectContainmentEList(TypeScope.class, this,
ProblemPackage.SCOPE_DECLARATION__TYPE_SCOPES);
}
return typeScopes;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ProblemPackage.SCOPE_DECLARATION__TYPE_SCOPES:
return ((InternalEList>) getTypeScopes()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ProblemPackage.SCOPE_DECLARATION__TYPE_SCOPES:
return getTypeScopes();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ProblemPackage.SCOPE_DECLARATION__TYPE_SCOPES:
getTypeScopes().clear();
getTypeScopes().addAll((Collection extends TypeScope>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ProblemPackage.SCOPE_DECLARATION__TYPE_SCOPES:
getTypeScopes().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ProblemPackage.SCOPE_DECLARATION__TYPE_SCOPES:
return typeScopes != null && !typeScopes.isEmpty();
}
return super.eIsSet(featureID);
}
} //ScopeDeclarationImpl