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