/** */ package hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Constant; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Function; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.ContainmentHierarchy; import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; 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.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectResolvingEList; /** * * An implementation of the model object 'Containment Hierarchy'. * *

* The following features are implemented: *

* * * @generated */ public class ContainmentHierarchyImpl extends MinimalEObjectImpl.Container implements ContainmentHierarchy { /** * The cached value of the '{@link #getTypesOrderedInHierarchy() Types Ordered In Hierarchy}' reference list. * * * @see #getTypesOrderedInHierarchy() * @generated * @ordered */ protected EList typesOrderedInHierarchy; /** * The cached value of the '{@link #getContainmentFunctions() Containment Functions}' reference list. * * * @see #getContainmentFunctions() * @generated * @ordered */ protected EList containmentFunctions; /** * The cached value of the '{@link #getContainmentRelations() Containment Relations}' reference list. * * * @see #getContainmentRelations() * @generated * @ordered */ protected EList containmentRelations; /** * The cached value of the '{@link #getRootConstant() Root Constant}' reference. * * * @see #getRootConstant() * @generated * @ordered */ protected Constant rootConstant; /** * * * @generated */ protected ContainmentHierarchyImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return LogicproblemPackage.Literals.CONTAINMENT_HIERARCHY; } /** * * * @generated */ public EList getTypesOrderedInHierarchy() { if (typesOrderedInHierarchy == null) { typesOrderedInHierarchy = new EObjectResolvingEList(Type.class, this, LogicproblemPackage.CONTAINMENT_HIERARCHY__TYPES_ORDERED_IN_HIERARCHY); } return typesOrderedInHierarchy; } /** * * * @generated */ public EList getContainmentFunctions() { if (containmentFunctions == null) { containmentFunctions = new EObjectResolvingEList(Function.class, this, LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_FUNCTIONS); } return containmentFunctions; } /** * * * @generated */ public EList getContainmentRelations() { if (containmentRelations == null) { containmentRelations = new EObjectResolvingEList(Relation.class, this, LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_RELATIONS); } return containmentRelations; } /** * * * @generated */ public Constant getRootConstant() { if (rootConstant != null && rootConstant.eIsProxy()) { InternalEObject oldRootConstant = (InternalEObject)rootConstant; rootConstant = (Constant)eResolveProxy(oldRootConstant); if (rootConstant != oldRootConstant) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, LogicproblemPackage.CONTAINMENT_HIERARCHY__ROOT_CONSTANT, oldRootConstant, rootConstant)); } } return rootConstant; } /** * * * @generated */ public Constant basicGetRootConstant() { return rootConstant; } /** * * * @generated */ public void setRootConstant(Constant newRootConstant) { Constant oldRootConstant = rootConstant; rootConstant = newRootConstant; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LogicproblemPackage.CONTAINMENT_HIERARCHY__ROOT_CONSTANT, oldRootConstant, rootConstant)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case LogicproblemPackage.CONTAINMENT_HIERARCHY__TYPES_ORDERED_IN_HIERARCHY: return getTypesOrderedInHierarchy(); case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_FUNCTIONS: return getContainmentFunctions(); case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_RELATIONS: return getContainmentRelations(); case LogicproblemPackage.CONTAINMENT_HIERARCHY__ROOT_CONSTANT: if (resolve) return getRootConstant(); return basicGetRootConstant(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LogicproblemPackage.CONTAINMENT_HIERARCHY__TYPES_ORDERED_IN_HIERARCHY: getTypesOrderedInHierarchy().clear(); getTypesOrderedInHierarchy().addAll((Collection)newValue); return; case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_FUNCTIONS: getContainmentFunctions().clear(); getContainmentFunctions().addAll((Collection)newValue); return; case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_RELATIONS: getContainmentRelations().clear(); getContainmentRelations().addAll((Collection)newValue); return; case LogicproblemPackage.CONTAINMENT_HIERARCHY__ROOT_CONSTANT: setRootConstant((Constant)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LogicproblemPackage.CONTAINMENT_HIERARCHY__TYPES_ORDERED_IN_HIERARCHY: getTypesOrderedInHierarchy().clear(); return; case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_FUNCTIONS: getContainmentFunctions().clear(); return; case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_RELATIONS: getContainmentRelations().clear(); return; case LogicproblemPackage.CONTAINMENT_HIERARCHY__ROOT_CONSTANT: setRootConstant((Constant)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LogicproblemPackage.CONTAINMENT_HIERARCHY__TYPES_ORDERED_IN_HIERARCHY: return typesOrderedInHierarchy != null && !typesOrderedInHierarchy.isEmpty(); case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_FUNCTIONS: return containmentFunctions != null && !containmentFunctions.isEmpty(); case LogicproblemPackage.CONTAINMENT_HIERARCHY__CONTAINMENT_RELATIONS: return containmentRelations != null && !containmentRelations.isEmpty(); case LogicproblemPackage.CONTAINMENT_HIERARCHY__ROOT_CONSTANT: return rootConstant != null; } return super.eIsSet(featureID); } } //ContainmentHierarchyImpl